Repository navigation
Role and Permission Implementation Plan
This document defines the final application-level authorization plan for Admin, Moderator, and Verification Coordinator roles in the Neighborhood Emergency Preparedness Hub.
User.role remains dedicated to community identity (STANDARD / EXPERT). Staff authorization is managed separately.
The system will use a separate staff-role axis with these values:
NONEMODERATORVERIFICATION_COORDINATORADMIN
These staff roles are independent from STANDARD and EXPERT.
Moderators are global.
A moderator can moderate content across all hubs. No hub-scoped moderation logic will be implemented.
| Permission | Moderator | Verification Coordinator | Admin |
|---|---|---|---|
| View hidden posts in moderation views | Yes | No | Yes |
Change post status (ACTIVE, HIDDEN, REMOVED) |
Yes | No | Yes |
| Delete any post | Yes | No | Yes |
| Delete any comment | Yes | No | Yes |
| Manage pin/lock features | No feature implemented | No | No feature implemented |
| Change forum global settings | No | No | Yes |
| Permission | Moderator | Verification Coordinator | Admin |
|---|---|---|---|
| Edit/delete any help request for policy reasons | Yes | No | Yes |
| Edit/delete any help offer for policy reasons | Yes | No | Yes |
| Delete any help comment for policy reasons | Yes | No | Yes |
| Force help request status changes for moderation | Yes | No | Yes |
| Permission | Moderator | Verification Coordinator | Admin |
|---|---|---|---|
| View public user profile | Yes | Yes | Yes |
Suspend/deactivate users (is_active=False) |
No | No | Yes |
| Assign or revoke staff roles | No | No | Yes |
Manage STANDARD / EXPERT role values |
No | No | Yes |
Manage Django operational flags (is_staff, is_superuser) through API |
No | No | No |
| Permission | Moderator | Verification Coordinator | Admin |
|---|---|---|---|
| View submitted expertise certification documents | No | Yes | Yes |
| Approve expertise certification | No | Yes | Yes |
| Reject expertise certification with reason | No | Yes | Yes |
| Request resubmission of certification | No | Yes | Yes |
| Manually override final certification decision | No | No | Yes |
The Verification Coordinator is responsible only for expertise-certification workflow.
Responsibilities:
- Review submitted certification evidence for expert claims.
- Mark submissions as approved, rejected, or resubmission-required.
- Record decision metadata (reviewer, timestamp, decision, reason).
- Trigger updates to expert-verification state in user-facing profile data.
Non-responsibilities:
- No forum moderation powers.
- No help-request/offer moderation powers.
- No account suspension powers.
- No staff-role assignment powers.
- No platform configuration powers.
A separate staff-role field will be added to accounts.User:
-
staff_role: enum withNONE,MODERATOR,VERIFICATION_COORDINATOR,ADMIN.
Certification workflow state will be represented explicitly:
-
certification_status:NOT_SUBMITTED,PENDING_REVIEW,APPROVED,REJECTED,RESUBMISSION_REQUIRED. -
certification_reviewed_by(FK to reviewer user). -
certification_reviewed_at(datetime). -
certification_review_note(text).
REGISTER and PATCH /me flows will not allow client-side mutation of staff_role.
Dedicated DRF permission classes will be implemented:
IsModeratorOrAdminIsVerificationCoordinatorOrAdminIsAdminOnly
Rules:
- Moderation endpoints require
IsModeratorOrAdmin. - Certification-review endpoints require
IsVerificationCoordinatorOrAdmin. - Staff-role assignment, suspension, and platform configuration require
IsAdminOnly. - Existing author-only write guards remain for normal users and are bypassed only on explicitly designated moderation endpoints.
The API surface will include dedicated endpoints for:
- Forum moderation actions.
- Help-content moderation actions.
- Expertise certification review actions.
- Admin-only staff-role management.
- Admin-only account suspension/reactivation.
No pin/lock endpoint family will be added.
Web and mobile clients will read and enforce role-based UI from authenticated user data.
Client behavior:
- Show moderation pages/actions only for
MODERATORandADMIN. - Show certification-review pages/actions only for
VERIFICATION_COORDINATORandADMIN. - Show staff-role management and account suspension UI only for
ADMIN. - Do not render pin/lock controls.
All privileged actions will be written to an audit trail.
Audit events include:
- Actor user ID and staff role.
- Target entity type and ID.
- Action name.
- Old and new values for state-changing operations.
- Timestamp.
Actions to log:
- Forum and help-content moderation decisions.
- Certification approval/rejection/resubmission decisions.
- Staff-role assignment/revocation.
- Account suspension/reactivation.
Test coverage will include:
- Permission-allow and permission-deny cases for each role and endpoint family.
- Verification workflow transition tests.
- Regression tests for existing standard/expert behavior.
Rollout sequence:
- Add schema and migrations.
- Add permission classes and protected endpoints.
- Add audit logging.
- Expose role fields in authenticated user payloads.
- Update frontend and mobile role-gated UI.
- Execute role-based integration tests.
- Moderator: Global content moderation for forum/help domains only.
- Verification Coordinator: Expertise certification assessment only.
- Admin: Full authority across moderation, verification, user lifecycle, and staff-role governance.
Team Members
- Weekly Meeting 1 (15.02.2026)
- Weekly Meeting 2 (23.02.2026)
- Weekly Meeting 3 (03.03.2026)
- Weekly Meeting 4 (11.03.2026)
- Weekly Meeting 5 (16.03.2026)
- Weekly Meeting 6 (23.03.2026)
- Weekly Meeting 7 (30.03.2026)
- Weekly Meeting 8 (06.04.2026)
- Weekly Meeting 9 (15.04.2026)
- Weekly Meeting 10 (29.04.2026)
- Weekly Meeting 11 (06.05.2026)
- Weekly Meeting 12 (11.05.2026)
- Lab 1 Report (12.02.2026)
- Lab 2 Report (19.02.2026)
- Lab 3 Report (26.02.2026)
- Lab 4 Report (05.03.2026)
- Lab 5 Report (12.03.2026)
- Lab 6 Report (26.03.2026)
- Lab 7 Report (02.04.2026)
- Lab 8 Report (16.04.2026)
- Lab 9 Report (30.04.2026)
- Lab 10 Report (07.05.2026)