lykmapipo / ngAA

DRY authentication and authorization for angular and ui-router
41 stars 13 forks source link

Grab all permissions and generate permit keys #6

Closed lykmapipo closed 9 years ago

lykmapipo commented 9 years ago

Should be able to iterate over all permission assigned to user and generate permit keys in the $rootScope to allow:

Permit keys may follow format isPermittedTo[permission] where permission if picked from the current assigned permissions to the user.

So if user has permission View report then isPermittedToViewReport will be available in $rootScope as a permit key for view reports.

It may then used in views as:

<div ng-show="isPermittedToViewReport"></div>

Or anywhere in codes as:


   if(isPermittedToViewReport){
     //codes
    ...
  }
lykmapipo commented 9 years ago

Check Divectives implementation for v0.2.0