feat(admin): implement CRUD endpoints for roles and permissions #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented a complete set of API endpoints for managing Roles and Permissions, restricted to Admin users.
This includes:
1.Roles CRUD (/api/roles)
2.Permissions CRUD (/api/permissions)
3.Assigning permissions to roles (/api/roles/:roleId/permissions)
All routes are protected by auth and RBAC middleware, accessible only to users with the Admin role.
Testing Done:
-Tested all endpoints locally using Postman with a valid Admin JWT token.
-Verified responses in Postman: creation of Role, creation of Permission, assigning Permission to Role, and fetching all roles.
Verified database updates in MongoDB Compass:
-roles collection contains the role(s) with assigned permissions.
-permissions collection contains all permissions created.
Screenshots:



Issues
closes #15
Checklist