Got help from this article:
https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies
I tried to create some policies for my actions , but in some actions I want to have multiple policies , and if user has either of them, they can have access to Actions of controller :
[Authorize(Policy = "CanAccessMenu1")]
[Authorize(Policy = "CanAccessMenu2")]
public async Task<IActionResult> ActionFroMultiplePolicies([FromBody] ActionRequest request)
{
//..............
}
how can I merge this policies ? can I use something like this?
[Authorize(Policy = "CanAccessMenu1, CanAccessMenu2")]
In this case , maybe I need to have some changes in this override functions. But I dont have any idea about that :
Protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, CanAccessRequirement requirement)
{
}
Thanks for any help