Skip to content

Backend - RBAC Middleware + Authorization #114

@liangricky7

Description

@liangricky7

RoleAuthorizationMiddleware.cs

Extracts the user ID from JWT, checks the User Role associated with the ID, then return 401/403 based on permissions checks. (will be added to Program.cs via running app.UseMiddleware())

this code is reliant on my (ricky) middleware for JWT auth, I will let you know when my part is ready

PermissionAttribute.cs custom attribute

Allows for doing [Permission(requiredRoleLevel: 5)] attributes to be attached to controller methods for easy RBAC integrations.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions