[@rxap/authorization](../wiki/globals) / IfHasPermissionDirective

# Class: IfHasPermissionDirective

Defined in: [if-has-permission.directive.ts:24](https://gitlab.com/rxap/packages/-/blob/8058138ff98d9e37b711846892c79ebc45ed17d4/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`](../wiki/Class.IfHasPermissionDirective)

Defined in: [if-has-permission.directive.ts:34](https://gitlab.com/rxap/packages/-/blob/8058138ff98d9e37b711846892c79ebc45ed17d4/packages/angular/authorization/src/lib/if-has-permission.directive.ts#L34)

#### Parameters

##### authorization

[`AuthorizationService`](../wiki/Class.AuthorizationService)

##### template

`TemplateRef`\<`any`\>

##### viewContainerRef

`ViewContainerRef`

##### cdr

`ChangeDetectorRef`

##### scope

`null` | `string`

#### Returns

[`IfHasPermissionDirective`](../wiki/Class.IfHasPermissionDirective)

## Properties

### else?

> `optional` **else**: `TemplateRef`\<`any`\>

Defined in: [if-has-permission.directive.ts:30](https://gitlab.com/rxap/packages/-/blob/8058138ff98d9e37b711846892c79ebc45ed17d4/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/8058138ff98d9e37b711846892c79ebc45ed17d4/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/8058138ff98d9e37b711846892c79ebc45ed17d4/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/8058138ff98d9e37b711846892c79ebc45ed17d4/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`
