def _get_contexts_for(self, action, resource_type):
    if ('permissions' not in session):
        return None
    permissions = session['permissions']
    if (permissions is None):
        return None
    if self._permission_match(self.ADMIN_PERMISSION, permissions):
        return None
    resource_types = get_contributing_resource_types(resource_type)
    ret = []
    for resource_type in resource_types:
        ret.extend(permissions.get(action, {}).get(resource_type, ()))
    admin_list = list(permissions.get(self.ADMIN_PERMISSION.action, {}).get(self.ADMIN_PERMISSION.resource_type, ()))
    ret.extend(admin_list)
    return ret
def _get_contexts_for(self, action, resource_type):
    if ('permissions' not in session):
        return None
    permissions = session['permissions']
    if (permissions is None):
        return None
    if self._permission_match(self.ADMIN_PERMISSION, permissions):
        return None
    resource_types = get_contributing_resource_types(resource_type)
    ret = []
    for resource_type in resource_types:
        ret.extend(permissions.get(action, {}).get(resource_type, ()))
    admin_list = list(permissions.get(self.ADMIN_PERMISSION.action, {}).get(self.ADMIN_PERMISSION.resource_type, ()))
    ret.extend(admin_list)
    return ret