2026-03-20 07:06:47 +00:00
# Issue #12: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
2026-03-16 12:06:33 +00:00
2026-03-20 07:06:47 +00:00
## Description
2026-03-20 08:07:25 +00:00
Implement role-based access control for dispute-related endpoints to ensure that only users with the appropriate roles (`user` , `moderator` , or `admin` ) can access specific dispute functionalities.
2026-03-16 12:06:33 +00:00
2026-03-20 07:06:47 +00:00
## Acceptance Criteria
2026-03-20 08:07:25 +00:00
- [x] Dispute creation endpoint is accessible only to `user` role
- [x] Dispute status change endpoint is accessible only to `moderator` and `admin` roles
- [x] Dispute final decision endpoint is accessible only to `admin` role
- [x] Integration tests are added to verify the role-based access control
- [x] Documentation is updated to reflect the new RBAC implementation
2026-03-16 12:06:33 +00:00
2026-03-20 07:06:47 +00:00
## Related Files
2026-03-20 08:07:25 +00:00
- `backend/src/routes/disputes.js`
2026-03-20 07:06:47 +00:00
- `backend/src/middleware/requireRole.js`
- `backend/src/controllers/dispute.controller.js`
2026-03-16 12:06:33 +00:00
2026-03-20 07:06:47 +00:00
## Notes
2026-03-20 08:07:25 +00:00
This issue builds upon the existing roles and permissions defined in `docs/roles-and-permissions.md` .