Skip to content

Releases: AlexKhymenko/ngx-permissions

v3.0.0

13 Nov 15:43
Compare
Choose a tag to compare

Fix correct role implementation.
When passing function to redirectTo it will use or operator.

v2.1.1

03 Oct 15:26
Compare
Choose a tag to compare

BugFix When passing an empty array, it should show the component.

v2.1.0

20 Sep 12:45
Compare
Choose a tag to compare

Implement canLoad guard
Implement canActivateChild guard

Add support for angular 5.

04 Sep 11:44
Compare
Choose a tag to compare

Add support for angular 5.

Version 2 for angular 4/5.
Version 1 for angular 2/4

v1.1.2

30 Aug 17:34
Compare
Choose a tag to compare

1.1.2

Small Bug Fixes

v1.1.1

28 Aug 11:25
Compare
Choose a tag to compare

1.1

BugFix

When ngxPermissionsOnly or ngxPermissionsExcept is falthy value should show the component

Should show
<div *ngxPermissionsOnly="">
   I should see this
</div>

v1.1.0

27 Aug 08:33
Compare
Choose a tag to compare

1.1

Features

Adding then else block functionality

Adding then else block functionality with ngxPermissionsExcept directive

  <div *ngxPermissionsExcept="['THEN_BLOCK']; else elseBlock; then thenBlock">main</div>
  <ng-template #elseBlock>
      <div>elseBlock</div>
  </ng-template>
  <ng-template #thenBlock>
      <div>thenBlock</div>
  </ng-template>

Adding then else block functionality with ngxPermissionsOnly directive

  <div *ngxPermissionsOnly="['THEN_BLOCK']; else elseBlock; then thenBlock">main</div>
  <ng-template #elseBlock>
      <div>elseBlock</div>
  </ng-template>
  <ng-template #thenBlock>
      <div>thenBlock</div>
  </ng-template>

Using with except and only together should use ngxPermissionsElse and ngxPermissionsThen

    <ng-template [ngxPermissionsExcept]="'FAIL_BLOCK'" 
    [ngxPermissionsOnly]="'ONLY_BLOCK'"
    [ngxPermissionsElse]="elseBlock"
    [ngxPermissionsThen]="thenBlock">
    </ng-template>
    <ng-template #elseBlock>
        <div>elseBlock</div>
    </ng-template>
    <ng-template #thenBlock>
        <div>thenBlock</div>
    </ng-template>

v1.0.0

24 Aug 16:32
Compare
Choose a tag to compare

Breaking changes from 0.1 to 1.0

Prevent name collision in Your application.
Add Prefix ngx to everything

Templates

Remove permissions directive cause it was not usable. Will not break anything Angular will just ignore it.

The reasoning if you want to use [permissions] as input in another component it will show error can't find template error.

from

<ng-template permissions [permissionsOnly]="['ADMIN', 'GUEST']">
    <div>You can see this text congrats</div>
</div>
<div *permissionsExcept="['ADMIN', 'GUEST']">
    <div>You can see this text congrats</div>
</div>

to

<ng-template [ngxPermissionsOnly]="['ADMIN', 'GUEST']">
    <div>You can see this text congrats</div>
</div>
<div *ngxPermissionsExcept="['ADMIN', 'GUEST']">
    <div>You can see this text congrats</div>
</div>

Services

Add Ngx Prefix to service name

PermissionsService > NgxPermissionsService

RolesService > NgxRolesService

PermissionsGuard > NgxPermissionsGuard

Directive

Add Ngx Prefix to directive name

PermissionsDirective > NgxPermissionsDirective