- ABP Framework version: v4.4.3
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace: Not able to get permissions on startup. Only triggers when loading Angular (http://localhost:4200)
- Steps to reproduce the issue:
- Startup Monolith Architecture for ABP.io V4.4.3
- Does not hit breakpoint on the override Define function in Permissions.
- When ng serve Angular, and load up http://localhost:4200, it will then hit the breakpoint.
Is there any way to get permissions on startup instead of waiting to serve the angular to define the permissions?
I have another project running the latest ABP.io V7.4.0 and noticed that it will hit on startup. What are the differences?
Thanks, Jordan
7 Answer(s)
-
0
Hi,
You can call the
IPermissionDefinitionManager.GetGroupsAsync
on theOnApplicationInitialization
.https://github.com/abpframework/abp/blob/0542f715aacac98d1723a146b26aaa64f7f283d7/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManager.cs#L14
I have another project running the latest ABP.io V7.4.0 and noticed that it will hit on startup. What are the differences?
Because we introduced dynamic permissions, it will be loaded when the application starts
-
0
Hi,
Thanks for the prompt reply. Does that mean if I do call this
IPermissionDefinitionManager.GetGroupsAsync
it will follow the latest version and load when the application starts?Thanks
-
0
Hi,
You can give it a try.
-
0
-
0
Try
AsyncHelper.RunSync(() => app.ApplicationServices.GetRequiredService<IPermissionDefinitionManager>().GetGroupsAsync());
-
0
Okay will try it out! Thanks!
Seems like
GetGroupsAsync()
in v4.3.0 is onlyGetGroups()
-
0
ok