def user_has_resource_db_permission(user_db, resource_db, permission_type):
 if (not cfg.CONF.rbac.enable):
  return True
 resolver = resolvers.get_resolver_for_permission_type(permission_type=permission_type)
 result = resolver.user_has_resource_db_permission(user_db=user_db, resource_db=resource_db, permission_type=permission_type)
 return result

def user_has_resource_db_permission ( user_db , resource_db , permission_type ) : if ( not cfg . CONF . rbac . enable ) : return True resolver = resolvers . get_resolver_for_permission_type ( permission_type = permission_type ) result = resolver . user_has_resource_db_permission ( user_db = user_db , resource_db = resource_db , permission_type = permission_type ) return result
check that the provided user has specified permission on the provided resource .