Skip to content

feat(auth): introduce role-based access control with Roles decorator …#54

Merged
Uyoxy merged 1 commit intostellarspend:mainfrom
lynaDev2:feature/rbac-admin-authorization
Mar 5, 2026
Merged

feat(auth): introduce role-based access control with Roles decorator …#54
Uyoxy merged 1 commit intostellarspend:mainfrom
lynaDev2:feature/rbac-admin-authorization

Conversation

@lynaDev2
Copy link
Copy Markdown
Contributor

@lynaDev2 lynaDev2 commented Mar 5, 2026

Summary

Introduces Role-Based Access Control (RBAC) to secure admin-only endpoints.

Changes

Added role field (user | admin) to User entity

Created @roles() decorator

Implemented RolesGuard

Protected admin routes (analytics export, user suspension, system config)

Acceptance Criteria

Admin routes accessible only to admin users

Non-admin users receive 403 Forbidden

@roles() decorator works across modules

How To Test

Login as normal user → access admin route → expect 403

Login as admin → access granted

@Uyoxy
Copy link
Copy Markdown
Contributor

Uyoxy commented Mar 5, 2026

lgtm

@Uyoxy Uyoxy merged commit ec5dd8d into stellarspend:main Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants