本文整理汇总了TypeScript中ngx-permissions.NgxPermissionsService类的典型用法代码示例。如果您正苦于以下问题:TypeScript NgxPermissionsService类的具体用法?TypeScript NgxPermissionsService怎么用?TypeScript NgxPermissionsService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NgxPermissionsService类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private permissionsService : NgxPermissionsService, private tokenStorage: TokenStorage){
console.log("Inside AppComponent constructor");
debugger;
let perms: [any]=[this.tokenStorage.getUsernameAuthority()];
//const perm = [perms[0].authority];
this.permissionsService.loadPermissions(perms);
debugger;
}
示例2: removeRoles
removeRoles() {
//this.permissionsService.removePermission('ROLE_ADMIN');
//this.permissionsService.removePermission('ROLE_USER');
//this.permissionsService.removePermission('ROLE_BAD');
this.permissionsService.flushPermissions();
}
示例3: addBadRole
addBadRole() {
this.permissionsService.addPermission('ROLE_BAD');
}
示例4: addUserRole
addUserRole() {
this.permissionsService.addPermission('ROLE_USER');
}
示例5: addAdminRole
//Temp code below
addAdminRole() {
this.permissionsService.addPermission('ROLE_ADMIN');
}