Skip to content

SnRolesAttribute for authorize any MVC endpoints #2234

Open

Description

@kavics

As a developer, I would like to use an attribute on MVC methods that defines the group membership that is required to use the method.
If the authenticated user does not have a group membership in any of the required groups, the method should generate a HTTP 403 (Forbidden) status code.

Typical usage example:

[SnRoles(N.R.Administrators, N.R.Developers)]
public async Task<IActionResult> SynchronizePlaces...

The N.R.Administrators and N.R.Developers are string constants with full path of the target groups e.g. /Root/IMS/BuiltIn/Portal/Administrators.

Microsoft.MVC dependency will probably be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions