nest-access-control
nest-access-control copied to clipboard
Unclear what the video - title attribute does in the example
The sample contains this code
roles
.grant(AppRoles.USER_CREATE_ANY_VIDEO) // define new or modify existing role. also takes an array.
.createOwn('video') // equivalent to .createOwn('video', ['*'])
.deleteOwn('video')
.readAny('video')
.grant(AppRoles.ADMIN_UPDATE_OWN_VIDEO) // switch to another role without breaking the chain
.extend(AppRoles.USER_CREATE_ANY_VIDEO) // inherit role capabilities. also takes an array
.updateAny('video', ['title']) // explicitly defined attributes
.deleteAny('video');
What exactly does the title attribute do in the "updateAny" line? Where is it checked?
it would allow you to define which attribute that role can update, for example, you can define they can only update the title of the video, but say, not the description of the video.
Could you please add a code sample? Still don't get it exactly how I would use it