Open
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
Current behavior
Currently there is no property in permissions
object to handle a case when we need to allow access user with PERMISSION_1 or PERMISSION_2.
Expected behavior
I would expect new property oneOf
that will check if user has one of listed permissions. This property should work with other properties as well (only
, except
).
Example:
{
path: 'test',
component: TestComponent,
canActivate: [NgxPermissionsGuard],
data: {
permissions: {
only: 'POST_WRITER',
oneOf: ['MODERATOR', 'REPORTER']
}
}
}
NgxPermissionGuard
should check it in following way: permissions.has('POST_WRITER') && (permissions.has('MODERATOR') || permissions.has('REPORTER'))
Metadata
Metadata
Assignees
Labels
No labels