'Return the current user\'s root organisation ID or None'

def root_org(self):

    if (not self.user):
        return None
    org_id = self.user.organisation_id
    if (not org_id):
        return None
    if (not current.deployment_settings.get_org_branches()):
        return org_id
    return current.cache.ram(('root_org_%s' % org_id), (lambda : current.s3db.org_root_organisation(org_id)), time_expire=120)
