Skip to main content

RBAC Manual Test Plan

Prerequisites

You need 3 test accounts for the same company, each with a different role tier:

AccountRoleExpected Tier
Admin userCompany Admin (or Super Admin)Full access
Member userRecruiter/HR (or Internal Sales)Can edit, cannot manage team
Viewer userExternal Sales, Economy, or Auditor/ViewerView only

Assign roles via the admin panel at /admin/settings/roles (Assignments tab) or during team invitation.


Test Matrix

For each section below, log in as all 3 roles and verify the expected behaviour.

Legend

  • V = Visible / Accessible
  • H = Hidden / Not visible
  • n/a = Not applicable

1. Jobs

Page: /company/jobs

ElementAdminMemberViewer
Job list (view)VVV
"Create" button (top bar)VVH
Card dropdown menu → EditVVH
Card dropdown menu → DeleteVVH
Card dropdown menu → DuplicateVVH
Card dropdown menu → AssignVVH
Card dropdown menu → ShareVVV
Card dropdown menu → ViewVVV

Page: /company/jobs/[jobId] (Job detail)

ElementAdminMemberViewer
View job detailsVVV
Recommended Talents → "Add as Candidate"VVH

Component: OptionsDropdown (3-dot menu on job detail/kanban)

ElementAdminMemberViewer
Publish on web toggleVVH
Priority toggleVVH
Assign toVVH
ShareVVV
EditVVH
DuplicateVVH
DeleteVVH

Kanban view: /company/jobs (kanban tab)

ElementAdminMemberViewer
View kanban boardVVV
Card dropdown → Edit/DeleteVVH
Status change (drag & drop)VVV*

*Status change is handled by the card header select, which is not role-gated. The backend should reject unauthorised status changes.


2. Candidates

Page: /company/resume/candidates

ElementAdminMemberViewer
View candidate listVVV
Card dropdown → EditVVH
Card dropdown → DeleteVVH
Card dropdown → AssignVVH
Card dropdown → DownloadVVV

Pipeline Kanban (candidates inside a pipeline)

ElementAdminMemberViewer
View kanbanVVV
Card dropdown → Edit/Delete/AssignVVH

3. Talents

Page: /company/resume/talents

ElementAdminMemberViewer
View talent listVVV
"Import" buttonVVH
"Add" buttonVVH
Card dropdown → EditVVH
Card dropdown → DeleteVVH

4. Talent Pools

Page: /company/resume/talentpool

ElementAdminMemberViewer
View pool listVVV
"Add Pool" buttonVVH
Card dropdown → EditVVH
Card dropdown → DeleteVVH

5. Share Lists

Page: /company/resume/sharelist

ElementAdminMemberViewer
View share listsVVV
"Add List" buttonVVH
Card dropdown → EditVVH
Card dropdown → ShareVVV
Card dropdown → DeleteVVH

6. Contacts

Page: /company/connections/contacts

ElementAdminMemberViewer
View contact listVVV
"Add" buttonVVH
"Import" buttonVVH
Card dropdown → EditVVH
Card dropdown → DeleteVVH
Card footer → Call/EmailVVV

7. Pipelines

Page: /company/pipeline (list view)

ElementAdminMemberViewer
View pipeline listVVV
"Add Pipeline" buttonVVH
Card footer → Edit linkVVH
Card footer → View linkVVV

8. Collaborating Partners

Page: /company/connections/collaboratingpartner

ElementAdminMemberViewer
View partner listVVV
"Invite" buttonVVH
Card dropdown → Accept (pending received)VVH
Card dropdown → Withdraw (pending sent)VVH
Card dropdown → Leave (active received)VVH
Card dropdown → DeleteVVH

9. Companies (Connections)

Page: /company/connections/companies

ElementAdminMemberViewer
View company listVVV
Connection request Accept/RejectVVH
Card dropdown → DisconnectVVH

10. Team Members (Admin-Only)

Page: /company/team/members or /userprofile/members

ElementAdminMemberViewer
View member listVVV
"Invite" buttonVHH
Card dropdown → Edit/DeleteVHH

11. Invitations (Admin-Only)

Page: /userprofile/invitation

ElementAdminMemberViewer
View invitationsVVV
"Invite" buttonVHH
Card dropdown → ResendVHH
Card dropdown → DeleteVHH

12. Company Settings (Admin-Only)

Page: /userprofile (company tab)

ElementAdminMemberViewer
View company infoVVV
Edit any field (click to activate)VHH
Save changes buttonVHH
Delete company buttonVHH

Edge Cases to Test

Role Switching

  1. Log in as an admin user who has roles in multiple companies
  2. Switch to a company where they are a Viewer
  3. Verify all write actions are hidden
  4. Switch back to the admin company
  5. Verify all write actions are restored

Super Admin Override

  1. Log in as a Super Admin (isSuperAdmin: true)
  2. Even if company role is Viewer or missing, all actions should be visible

New User (No Role)

  1. Create a user with no UserCompanyRole for the company
  2. Verify they see view-only UI (same as Viewer)

Direct URL Navigation

  1. As a Viewer, try navigating directly to:
    • /company/jobs/createjob — page should still load, but backend will reject the mutation
    • /company/resume/candidates/add — same behaviour
    • /company/resume/talentpool/add — same behaviour
  2. The frontend hides the navigation buttons, but we don't block the routes themselves. The backend handles unauthorised mutation attempts.

Browser Back Button

  1. As Admin, navigate to an edit page
  2. Switch to Viewer role
  3. Press browser back — verify no stale edit UI appears

Loading State

  1. On slow connections, verify that buttons don't flash visible then disappear
  2. The useCompanyRole hook uses cache-and-network, so cached role data should prevent this

Regression Checks

These features should continue to work exactly as before:

  • Jobseeker pages — all actions remain visible (jobseekers are unrestricted)
  • Admin panel (/admin/*) — fully accessible to Super Admins
  • Support portal — accessible to support agents and super admins
  • Login / logout flow — no changes
  • Role switching between companies — role updates correctly
  • Card view/list/table toggle — works across all views
  • Pagination — works correctly with filtered actions
  • Search and filters — unaffected
  • Share / Download / View actions — always visible regardless of role