Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
YouTube Security VideosNutanix advances legacy and AI app management with AMD(01.10.2026 um 16:00 Uhr)
•
YouTube Security VideosPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••••
Videos & KonferenzenPC-WELT: 32 TB SSD-Speicher in der HMX 6!(01.10.2026 um 16:15 Uhr)
••
Sicherheitslücken (CVE)USN-8857-1: KCoreAddons vulnerability(01.10.2026 um 12:48 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

angular-rbac the RBAC lightweight library for your next 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…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

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






<div
*canAccess="{ roles: ['admin'], permissions: ['user-delete'] }; other: noPermissionTemplate">
<div>Protected users list here</div>
</div>

<ng-template #noPermissionTemplate>
<p>You do not have permission!</p>
</ng-template>









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




 {
path: "planet",
component: LayoutComponent,
loadChildren: () => import("./features/planet/planet.routes").then((routes) => routes.PLANET_ROUTES),
canActivateChild: [canActivateChildAccessGuard({ roles: ["admin"], permissions: ["read-planets", "create-planets"] }, "/auth/login", true)],
}






Check it out

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

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

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten angular-rbac the RBAC lightweight library for your next Angular projects

Thematisch verwandte Begriffe: angularrbac, RBAC, lightweight, library · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag