Closed lykmapipo closed 9 years ago
Should be able to iterate over all permission assigned to user and generate permit keys in the $rootScope to allow:
$rootScope
Permit keys may follow format isPermittedTo[permission] where permission if picked from the current assigned permissions to the user.
isPermittedTo[permission]
So if user has permission View report then isPermittedToViewReport will be available in $rootScope as a permit key for view reports.
View report
isPermittedToViewReport
It may then used in views as:
<div ng-show="isPermittedToViewReport"></div>
Or anywhere in codes as:
if(isPermittedToViewReport){ //codes ... }
Check Divectives implementation for v0.2.0
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
thenisPermittedToViewReport
will be available in$rootScope
as a permit key for view reports.It may then used in views as:
Or anywhere in codes as: