ngx-permissions & material design issue
See original GitHub issueHi Alex,
I’m using Angular 7 and ngx-permissions v 6.0.6 and it looks like the strategies are not working if the material design is used. A brief example:
<button mat-raised-button color="primary" (click)='test()'
*ngxPermissionsOnly="['ADMIN']; unauthorisedStrategy: 'ngxDisableElement'">
ADMIN-enabled (1)
</button>
<button (click)='test()' *ngxPermissionsOnly="['ADMIN']; unauthorisedStrategy: 'ngxDisableElement'">
ADMIN-enabled (2)
</button>
In this example ADMIN-enabled (1)
is always enabled no matter if an user is ADMIN or not. Second one ADMIN-enabled (2)
has correct behaviour (disabled if the user is not ADMIN).
ngxDisableElement is identical with your example:
this.ngxpcs.addPermissionStrategy('ngxDisableElement', (tF: TemplateRef<any>) => {
this.renderer2.setAttribute(tF.elementRef.nativeElement.nextSibling, 'disabled', 'true');
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
ngx-permissions not working in child-components (angular 14)
BUT when I add *ngxPermissionsOnly="['ADMIN']" to app.component.html it works! So It's facing the problem just for child components!
Read more >Angular Ngxpermission Material Issue - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >ngx-datepickerrange - npm Package Health Analysis - Snyk
This plugin have an independant theme which looks more close to material design, so the material design is just a style. demo: https://fetrarij....
Read more >Android permissions - Material Design
Android apps have limited permissions associated with them by default. If your app selected to apply “normal” permissions, the system automatically grants ...
Read more >Dealing With Permissions in Angular and NgRx
Using CanActivate guards only solves one part of the problem for us. ... In our example app, we designed the permission system for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi Alex,
thanks for info and feedback. Have a nice day 😃.
Same issue here, i use material icons in material stepper and icons cannot be rendered in a ng-template using ngxPermissions