Breaking change minimal rxjs dependency is 6.0
Add Unauthorised strategies
BREAKING CHANGE MINIMAL rxjs dependency is 5.5
Optimise directive when working with lot of data(prevent re rendering);
Fix bug with not resetting permissions on loadPermissions
Add NgxPermissionsAllowStubDirective, NgxPermissionsRestrictStubDirective for testing
Improve typescript support Don't show template on initial load.
Fix correct role implementation. When passing function to redirectTo it will use or operator.
BugFix When passing empty array. it should show the component.
Implement canLoad interface Implement canActivateChild interface
Add support for angular 5.
Version 2 for angular 4/5. Version 1 for angular 2/4
###Small Bug Fixes
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>
Prevent name collision in Your application. Add Prefix ngx to everything
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>
Add Ngx
Prefix to service name
PermissionsService > NgxPermissionsService
RolesService > NgxRolesService
PermissionsGuard > NgxPermissionsGuard
Add Ngx
Prefix to directive name
PermissionsDirective > NgxPermissionsDirective