def create_permission_grant(role_db, resource_uid, resource_type, permission_types):
 permission_grant_db = PermissionGrantDB(resource_uid=resource_uid, resource_type=resource_type, permission_types=permission_types)
 permission_grant_db = PermissionGrant.add_or_update(permission_grant_db)
 role_db.update(push__permission_grants=str(permission_grant_db.id))
 return permission_grant_db

def create_permission_grant ( role_db , resource_uid , resource_type , permission_types ) : permission_grant_db = PermissionGrantDB ( resource_uid = resource_uid , resource_type = resource_type , permission_types = permission_types ) permission_grant_db = PermissionGrant . add_or_update ( permission_grant_db ) role_db . update ( push__permission_grants = str ( permission_grant_db . id ) ) return permission_grant_db
create a new permission grant and add it to the provided role .