Good day,
Is there a way in boilerplate to extend the AbpAuthorize attribute ?
I want to achieve the following:
When an authorized application service function is called , I want to execute some logic without adding a custom attribute to each authorized application service.
Thanks in advance.
2 Answer(s)
-
0
Hi,
You can create a new class deriving from <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Authorization/AuthorizationHelper.cs">https://github.com/aspnetboilerplate/as ... nHelper.cs</a>. Then you can override the methods you want and execute your logic.
You also need to replace IAuthorizationHelper interface's implementation with your custom one like below in the PreInitialize method of your core module;
Configuration.ReplaceService<IAuthorizationHelper, MyAuthorizationHelper >(DependencyLifeStyle.Transient);
-
0
Hi,
Thanks in a million. Works like a bom!