I implemented my own PermissionChecker, which works fine. I also implemented my own AuthorizationProvider, which works also fine. The only thing is that the PermissionManager.GetAllPermissions() always returns permissions from all AuthorizationProviders. That's because of the following line of code in the initialize of the PermissionManager
foreach (var providerType in _authorizationConfiguration.Providers)
In most cases I want all permissions to be loaded, but not always. How can I get permissions from one AuthorizationProvider without changing code in PermissionManager? Or even better, how could I control this with a parameter?
5 Answer(s)
-
0
The current design is difficult to achieve your needs. You can try to remove the existing
AuthorizationProvider
//Adding authorization providers Configuration.Authorization.Providers.Clear(); Configuration.Authorization.Providers.Add<MyAuthorizationProvider>();
-
0
This won't work for me, because sometimes I want the whole list and sometimes the seperate list
-
0
If it doesn't change the design and code of the framework, it seems impossible to achieve.
If you think this is necessary, we can discuss it in the aspnetboilerplate. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new
-
0
This issue is closed because it has not had recent activity for a long time.
-
0
Perhaps for other developers who run into the same thing, I was able to solve it with the properties paramter when defining the permissions in AppAuthorizationProvider, see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1943