Skip to content

feat: support ASP.NET role authorization on endpoints #4

@tmeckel

Description

@tmeckel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions