def remove_permission_grant_for_resource_db(role_db, resource_db, permission_types):
 permission_types = _validate_permission_types(resource_db=resource_db, permission_types=permission_types)
 resource_uid = resource_db.get_uid()
 resource_type = resource_db.get_resource_type()
 permission_grant_db = PermissionGrant.get(resource_uid=resource_uid, resource_type=resource_type, permission_types=permission_types)
 role_db.update(pull__permission_grants=str(permission_grant_db.id))
 return permission_grant_db

def remove_permission_grant_for_resource_db ( role_db , resource_db , permission_types ) : permission_types = _validate_permission_types ( resource_db = resource_db , permission_types = permission_types ) resource_uid = resource_db . get_uid ( ) resource_type = resource_db . get_resource_type ( ) permission_grant_db = PermissionGrant . get ( resource_uid = resource_uid , resource_type = resource_type , permission_types = permission_types ) role_db . update ( pull__permission_grants = str ( permission_grant_db . id ) ) return permission_grant_db
remove a permission grant from a role .