Closed migueltercero closed 1 year ago
@migueltercero Yes its possible just create stub with all permissions and load it in loadPermissions function.
Thank you for your quick response.
We understand that your solution is do something like this:
this.permissions.service.loadPermissions(['permission1', 'permission2'] ....)
Load all permissions. Is correct?
The problem is that this shared component don´t knows permissions of each application, only each application knows their permissions.
For example, if we can define a pattern like this.permissions.service.loadPermissions('*')
, this can be applied to a shared component. Or if we can rewrite some funtion that always return true ...
Thank you.
In this case You need to inject stub directive instead of real for example this one https://github.com/AlexKhymenko/ngx-permissions/blob/master/projects/ngx-permissions/src/lib/testing/permissions-allow.directive.stub.ts
Ok, we will test your solution.
You can close this issue.
Thank you!!!
I'm submitting a...
Current behavior
We have a layout component that imports and use ngx-permissions. This layout component is used by multiple applications.
Some applications don´t require security. For theses applications, we have a flag to disable security. The problem is they can´t disable ngx-permissions because import module is in layout component.
Can be disable ngx-permission in runtime even if NgxPermissionsModule.forRoot() is imported?
Thanks.
Expected behavior
Have a flag or function to disable ngx-permission evnt if NgxPermissionsModule.forRoot() is imported