Can i make Authorize Like this in .net Core API:
[Authorize(Roles = "SUPPORT") OR Policy = "SuperUser"]
public IActionResult MyMethod()
{
...
}
mean if user has "SUPPORT" role OR has "SuperUser" Police can access to MyMethod.
Can i make Authorize Like this in .net Core API:
[Authorize(Roles = "SUPPORT") OR Policy = "SuperUser"]
public IActionResult MyMethod()
{
...
}
mean if user has "SUPPORT" role OR has "SuperUser" Police can access to MyMethod.
According to your description, I suggest you could put multiple Authorize attribute to achieve your requirement.
Like below:
[Authorize(Policy = "SuperUser")]
[Authorize(Roles = "SUPPORT")]
public IActionResult MyMethod()
{
...
}