Skip to main content

IfPermissionsDirective

Conditionally shows/hides templates based on the current active user having the specified permission. Based on the ngIf source. Also support "else" templates:

Example

Html

The permission can be a single string, or an array. If an array is passed, then all of the permissions must match (logical AND)

Signature
  • Extends: IfDirectiveBase<Array<Permission[] | null>>

constructor

method(_viewContainer: ViewContainerRef, templateRef: TemplateRef<any>, changeDetectorRef: ChangeDetectorRef, permissionsService: PermissionsService) => IfPermissionsDirective
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page