import { RolesBuilder } from 'nest-access-control' ; export enum AppRoles { USER_CREATE_ANY_VIDEO = 'USER_CREATE_ANY_VIDEO' , ADMIN_UPDATE_OWN_VIDEO = 'ADMIN_UPDATE_OWN_VIDEO' } export const roles = new RolesBuilder ( ) ; roles . grant ( AppRoles . USER_CREATE_ANY_VIDEO ) . createOwn ( 'video' ) . deleteOwn ( 'video' ) . readAny ( 'video' ) . grant ( AppRoles . ADMIN_UPDATE_OWN_VIDEO ) . extend ( AppRoles . USER_CREATE_ANY_VIDEO ) . updateAny ( 'video' , [ 'title' ] ) . deleteAny ( 'video' ) ;