def create_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()
 result = create_permission_grant(role_db=role_db, resource_uid=resource_uid, resource_type=resource_type, permission_types=permission_types)
 return result

def create_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 ( ) result = create_permission_grant ( role_db = role_db , resource_uid = resource_uid , resource_type = resource_type , permission_types = permission_types ) return result
create a new permission grant for a resource and add it to the provided role .