angular-rbac your lightweight RBAC library for angular projects

angular-rbac your lightweight RBAC library for angular projects

For a complete access control for your application, you will probably need two things:

  • DOM control to show or hide parts of your view based on the user Roles/Permissions.
  • Protect your routes by preventing a visitor from accessing administrator pages.
  • Control routes loading based on roles and pernissions; this is what Angular CanMatch provides to load a route or not based on a condition.

angular-rbac provides all the above features through:


CanAccessDirective Directive for DOM control


Three prebuilt RBAC guards

angular-rbac guards take the allowed roles and permissions to access a specific route, the redirectUrl in case of failure and boolean for skipLocationChange

  • canActivateAccessGuard for routes activation CanActivate
  • canActivateChildAccessGuard for children activation CanActivateChild
  • canMatchAccessGuard for route loading based on condition CanMatch

Check it out

Github: https://github.com/fatehMohamed14/angular-rbac

NPM: https://www.npmjs.com/package/@fatehmoh/angular-rbac

要查看或添加评论,请登录

社区洞察

其他会员也浏览了