def _permission_match(self, permission, permissions):
    return (permission.context_id in permissions.get(permission.action, {}).get(permission.resource_type, []))
def _permission_match(self, permission, permissions):
    return (permission.context_id in permissions.get(permission.action, {}).get(permission.resource_type, []))