feat: implement role-based access control for dispute endpoints
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit is contained in:
parent
83185aea1a
commit
df4a9fb9df
2 changed files with 11 additions and 11 deletions
18
ISSUE-12.md
18
ISSUE-12.md
|
|
@ -1,19 +1,19 @@
|
||||||
# Issue #12: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
|
# Issue #12: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
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.
|
Implement role-based access control for dispute-related endpoints to ensure that only users with the appropriate roles (`user`, `moderator`, or `admin`) can perform specific actions on disputes.
|
||||||
|
|
||||||
## Acceptance Criteria
|
## Acceptance Criteria
|
||||||
- [x] Dispute creation endpoint is accessible only to `user` role
|
- [x] Middleware `requireRole` is implemented and tested
|
||||||
- [x] Dispute status change endpoint is accessible only to `moderator` and `admin` roles
|
- [x] Dispute endpoints are protected by appropriate role checks
|
||||||
- [x] Dispute final decision endpoint is accessible only to `admin` role
|
- [x] Integration tests verify correct access control for different user roles
|
||||||
- [x] Integration tests are added to verify the role-based access control
|
- [x] Documentation of RBAC in `docs/roles-and-permissions.md` is updated
|
||||||
- [x] Documentation is updated to reflect the new RBAC implementation
|
|
||||||
|
|
||||||
## Related Files
|
## Related Files
|
||||||
- `backend/src/routes/disputes.js`
|
|
||||||
- `backend/src/middleware/requireRole.js`
|
- `backend/src/middleware/requireRole.js`
|
||||||
- `backend/src/controllers/dispute.controller.js`
|
- `backend/src/middleware/requireRole.test.js`
|
||||||
|
- `backend/src/dispute-flow/`
|
||||||
|
- `docs/roles-and-permissions.md`
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
This issue builds upon the existing roles and permissions defined in `docs/roles-and-permissions.md`.
|
This task builds upon the existing role-based access control implementation and focuses specifically on dispute-related functionality. The middleware should be used to protect endpoints in the dispute flow.
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
## Issue Template for helpyourneighbour
|
## Issue Template for helpyourneighbour
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
Describe the task to be done.
|
Brief description of the task to be done.
|
||||||
|
|
||||||
### Acceptance Criteria
|
### Acceptance Criteria
|
||||||
- [ ] Criterion 1
|
- [ ] Criterion 1
|
||||||
|
|
@ -13,4 +13,4 @@ Describe the task to be done.
|
||||||
- File 2
|
- File 2
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
Any additional context or notes.
|
Additional context or information.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue