Is there an option to set-up accesscontrol that some group of users, lets say Moderators,
can only create resource for everybody else, but not for themselves? Currently I did it like this:
{ role: 'moderator', resource: 'thing', action: 'create:any', attributes: 'createAnyButNotOwn' },
and then when checking for own:
let permission = null;
if (owned) {
permission = ac.can( user.role ... etc );
if (permission.attributes.indexOf('createAnyButNotOwn') > -1) {
permission = false;
}
}
Is there an option to set-up accesscontrol that some group of users, lets say Moderators, can only create resource for everybody else, but not for themselves? Currently I did it like this:
{ role: 'moderator', resource: 'thing', action: 'create:any', attributes: 'createAnyButNotOwn' },
and then when checking for own:Is there a better way? Thanks