@rxap/authorization
Version:
Provides an Angular module and directives to manage authorization and permissions in your application. It allows you to control the visibility and enabled state of UI elements based on user permissions. The package includes an `AuthorizationService` to ch
106 lines (56 loc) • 2.72 kB
Markdown
[**@rxap/authorization v19.0.3**](../README.md)
***
[@rxap/authorization](../globals.md) / IfHasPermissionDirective
# Class: IfHasPermissionDirective
Defined in: [if-has-permission.directive.ts:24](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L24)
## Implements
- `OnInit`
- `OnDestroy`
## Constructors
### new IfHasPermissionDirective()
> **new IfHasPermissionDirective**(`authorization`, `template`, `viewContainerRef`, `cdr`, `scope`): [`IfHasPermissionDirective`](IfHasPermissionDirective.md)
Defined in: [if-has-permission.directive.ts:34](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L34)
#### Parameters
##### authorization
[`AuthorizationService`](AuthorizationService.md)
##### template
`TemplateRef`\<`any`\>
##### viewContainerRef
`ViewContainerRef`
##### cdr
`ChangeDetectorRef`
##### scope
`null` | `string`
#### Returns
[`IfHasPermissionDirective`](IfHasPermissionDirective.md)
## Properties
### else?
> `optional` **else**: `TemplateRef`\<`any`\>
Defined in: [if-has-permission.directive.ts:30](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L30)
***
### identifier
> **identifier**: `string`
Defined in: [if-has-permission.directive.ts:27](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L27)
## Methods
### ngOnDestroy()
> **ngOnDestroy**(): `void`
Defined in: [if-has-permission.directive.ts:67](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L67)
A callback method that performs custom clean-up, invoked immediately
before a directive, pipe, or service instance is destroyed.
#### Returns
`void`
#### Implementation of
`OnDestroy.ngOnDestroy`
***
### ngOnInit()
> **ngOnInit**(): `void`
Defined in: [if-has-permission.directive.ts:49](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L49)
A callback method that is invoked immediately after the
default change detector has checked the directive's
data-bound properties for the first time,
and before any of the view or content children have been checked.
It is invoked only once when the directive is instantiated.
#### Returns
`void`
#### Implementation of
`OnInit.ngOnInit`