https://learn.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-8.0
Must support
[Authorize(Roles = "PowerUser")]
[Authorize(Roles = "ControlPanelUser")]
public class ControlPanelController : Controller
{
public IActionResult Index() =>
Content("PowerUser && ControlPanelUser");
}
and
[Authorize(Roles = "HRManager,Finance")]
public class SalaryController : Controller
{
public IActionResult Payslip() =>
Content("HRManager || Finance");
}
Use vendor extention x-aspnetcore-authorize-role to specify the list of roles and x-aspnetcore-authorize-policy-all-required (bool), when set separate Authorize tags will be created, otherwise one Authorize tag with all specified roles combined into a comma separated string.
https://learn.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-8.0
Must support
and
Use vendor extention
x-aspnetcore-authorize-roleto specify the list of roles andx-aspnetcore-authorize-policy-all-required(bool), when set separate Authorize tags will be created, otherwise one Authorize tag with all specified roles combined into a comma separated string.