How to reach the page: there is no direct sidebar link. Log in as ADMIN → sidebar Organization > Settings → click the "Roles & Permissions" card (route /admin/roles).
Prerequisites
User logged in with ADMIN role (admin@rcme.membervu.com / Admin123!).
Default system roles + permissions initialized for the tenant (RCME seed does this).
Test Data — System Roles (all are system / non-deletable)
Role Code
Display Name
Is System
Deletable
ADMIN
Administrator
Yes
No
OFFICER
Officer
Yes
No
FINANCE_MANAGER
Treasurer
Yes
No
EVENT_MANAGER
Events Manager
Yes
No
MEMBERSHIP_MANAGER
Membership Manager
Yes
No
COMMUNICATIONS_MANAGER
Communications Manager
Yes
No
MEMBER
Member
Yes
No
PENDING_MEMBER
Pending Member
Yes
No
EXPIRED_MEMBER
Expired Member
Yes
No
GUEST
Guest
Yes
No
Test Cases
TC-RBAC-001: View All Roles
Step
Action
Expected Result
1
Login as ADMIN. Open Settings → "Roles & Permissions" card.
Roles & Permissions page (/admin/roles) loads.
2
Look at the left "Roles" panel.
Roles grouped under "System Roles" and "Custom Roles" headers.
3
Verify all 10 system roles present.
ADMIN, OFFICER, FINANCE_MANAGER, EVENT_MANAGER, MEMBERSHIP_MANAGER, COMMUNICATIONS_MANAGER, MEMBER, PENDING_MEMBER, EXPIRED_MEMBER, GUEST — each with a "System" lock badge.
4
Verify each row shows colour dot, role name, role code (monospace), and user count.
Lists users with this role (e.g. Ana Reyes), or "0".
TC-RBAC-003: Create New Custom Role
Step
Action
Expected Result
1
Click "New Role" (left panel header).
"Create New Role" modal opens.
2
Enter Role Name: "Volunteer Coordinator".
Code auto-fills as VOLUNTEER_COORDINATOR (uppercase).
3
Enter a Description; pick a Colour.
Values set.
4
Click "Create Role".
Calls POST /api/admin/roles. Toast "Role created successfully". New role auto-selected, appears under "Custom Roles" with 0 permissions.
Note: the create modal has NO permission picker — permissions are granted afterward in the detail panel matrix (TC-RBAC-002 in the Permission Assignment set).
TC-RBAC-004: Create Role — Validation
Step
Action
Expected Result
1
Open "New Role" modal. Leave Name empty.
"Create Role" button disabled.
2
Type a Code containing lowercase / spaces.
Normalized to UPPERCASE_UNDERSCORE; hint "Uppercase letters, numbers, and underscores only".
3
Enter Code ADMIN (a system code) and submit.
Rejected — code conflicts with a system role.
4
Enter the code of an existing custom role and submit.
Rejected — duplicate code within tenant.
TC-RBAC-005: Edit Role Metadata (name / description / colour)
Step
Action
Expected Result
1
Select any role. Click the pencil icon next to its name.
Inline name editor appears.
2
Change the name, press Enter (or blur).
Calls PUT /api/admin/roles/:roleId. Name updated.
3
Note: this works for system roles too (name/description/colour are editable).
System role name can be changed; the code stays immutable.
TC-RBAC-006: Cannot Delete System Role
Step
Action
Expected Result
1
Select ADMIN. Look for a delete (trash) button in the detail header, and open the ⋮ menu on its row.
No Delete option exists for system roles — the trash button is absent and the ⋮ menu shows only "Duplicate".
2
API: DELETE /api/admin/roles/<ADMIN role id>.
Status 400 — system roles cannot be deleted.
TC-RBAC-007: Delete Custom Role (with reassignment)
Step
Action
Expected Result
1
Select a custom role with NO assigned users. Click Delete (⋮ menu or trash icon).
Expected:201 Created — { "role": { "id", "code": "VOLUNTEER_COORDINATOR", "isSystem": false, "permissions": [] } }. (Permissions are set via a separate call — see TC-RBAC-API-008.)
TC-RBAC-API-003: PUT /api/admin/roles/:roleId (metadata)
Request:PUT /api/admin/roles/<roleId> body { "description": "Updated description", "color": "#10B981" } → Expected:200 OK. Body may contain any subset of name/description/color/icon. code is NOT updatable.
TC-RBAC-API-004: DELETE /api/admin/roles/:roleId
Custom role, no users: DELETE /api/admin/roles/<customId> → 200 OK{ "success": true }. With users: add ?reassignTo=<targetRoleId>.
TC-RBAC-API-005: DELETE System Role (blocked)
DELETE /api/admin/roles/<ADMIN id> → Expected:400 Bad Request — system roles cannot be deleted.
TC-RBAC-API-006: POST /api/admin/roles/:roleId/duplicate
POST /api/admin/roles/<EVENT_MANAGER id>/duplicate body { "name": "Event Coordinator", "code": "EVENT_COORDINATOR" } → Expected:201 Created; new role copies all source permissions.