Closed Tumetsu closed 4 years ago
Hi @Tumetsu use NgxRolesService .addRoleWithPermissions('ADMIN', ['read', 'write']); added in latest version of the library
more information about roles here
https://github.com/AlexKhymenko/ngx-permissions/wiki/Managing-roles
We have a use case where we list of roles from server the user should have. For example:
And we would like to define permissions for each role as such:
The problem is that currently as far as I understand the
loadPermissions
loads the available permissions for the user and the role definitions just lets us to use role names in guards etc.Would it be possible to use
loadPermissions
(or rather some other method, e.g.loadRoles
) with role, so that it loads all permissions which have been defined for said role?So for example:
This would make sense in situations where some auth server or whatever knows only the roles of the certain user, and its application's responsibility to know which permissions the said role has in the application (which views to access etc.)