Skip to content

Role based login in ng-matero application #566

Closed Answered by nzbin
rahulpd101 asked this question in Q&A
Discussion options

You must be logged in to vote

The in-mem-data.service is just used for example, I'm not sure how you does with it. If you have an API with roles, you should call it and bind the roles in the startup.service. After that, you can get the roles and permissions with ngx-permissions services in the whole app.

private setPermissions(user: User) {
// In a real app, you should get permissions and roles from the user information.
const permissions = ['canAdd', 'canDelete', 'canEdit', 'canRead'];
this.permissonsService.loadPermissions(permissions);
this.rolesService.flushRoles();
this.rolesService.addRoles({ ADMIN: p…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rahulpd101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants