Skip to main content

User Roles & Permissions

The Admin UI enforces a two-tier role system: System roles for platform operators, and Organisation roles for association members.


Authentication Flow

  1. The user visits the login page and selects their context: Platform Admin or Organisation Member
  2. They submit their email + password (organisation users also provide their org identifier)
  3. The backend validates credentials and returns a JWT access token + refresh token
  4. Tokens are stored in HTTP cookies (__auth_access_token, __auth_refresh_token)
  5. The UI auto-refreshes the access token before it expires using the refresh token
  6. On logout (or a 401 response), tokens are cleared and the user is redirected to the login page

System Roles (Platform Users)

Platform users authenticate at /platform/login and access the /_platform/* route tree.

RoleDescription
SUPER_ADMINUnrestricted access to the entire platform; can impersonate any organisation context
PLATFORM_ADMINFull administrative access across all organisations
SUPPORT_ADMINRead access to organisations and members for customer support
BILLING_ADMINAccess to billing, subscriptions, and invoices
CONTENT_MODERATORAccess to articles and content moderation tools

Organisation context switching (SUPER_ADMIN)

A SUPER_ADMIN can switch into any organisation's context using the organisation switcher in the platform nav. This allows them to view and manage that organisation's data as if they were an org admin.


Organisation Roles

Organisation users authenticate at /org/:slug/login and access the /org/:slug/* route tree. Each user belongs to exactly one organisation and is assigned one role within it.

Roles are defined per-organisation by the organisation admin. The specific role names are configurable, but typically include:

Common RoleTypical Access
AdminFull access within the organisation
ManagerManage members, events, and content; cannot change billing or org settings
MemberRead-only access to published events, articles, and the member directory

The exact set of roles and their names depend on what the organisation admin has configured.


Authorities (Fine-Grained Permissions)

Each role — both system and organisation — carries a list of authorities that control specific actions. The UI uses these to conditionally render buttons, forms, and entire sections.

How authorities work

When a user logs in, their authorities array is included in the JWT payload. The frontend checks individual authorities before rendering protected UI:

// Example: only show "Create Event" button if user has this authority
const { hasAuthority } = useAuth();

if (hasAuthority('events.write')) {
// render create button
}

Common authority patterns

AuthorityProtected capability
members.readView member list and profiles
members.writeInvite, update, or remove members
events.readView events list
events.writeCreate and edit events
events.publishPublish or unpublish events
events.registrations.writeApprove/reject/check-in registrations
articles.writeCreate and edit articles
documents.writeUpload and manage documents
billing.readView billing overview and invoices
billing.writeManage subscriptions and record payments
audit-logs.readView system audit logs
settings.writeUpdate organisation or platform settings
info

The authority list is defined and managed in the backend. The frontend reads and checks them but does not define them. Refer to the backend documentation for the full authority reference.


Route Protection

Routes are protected at two levels:

1. Route-level guards (TanStack Router)

Every protected route checks the user's authentication state and role before rendering. Unauthenticated users are redirected to the login page with a returnUrl parameter.

User visits /_platform/billing
→ Not authenticated → redirect to /platform/login?returnUrl=/_platform/billing
→ Authenticated as ORGANISATION user → redirect to /403
→ Authenticated as BILLING_ADMIN → render billing page

2. Backend enforcement

All API endpoints enforce permissions server-side. The UI hiding a button is a UX enhancement only — the backend will reject any unauthorised request with a 403 Forbidden response regardless.


Error Pages

RouteShown when
/401User is not authenticated
/403User is authenticated but lacks permission for the requested resource
/404The requested page or resource does not exist
/500An unexpected server error occurred
/503The backend is unreachable or in maintenance mode

Managing Organisation Roles

Organisation admins can manage roles via the platform's admin role panel (/_platform/admin-roles). From there you can:

  • View all system roles and their assigned authorities
  • Create custom roles
  • Add or remove authorities from a role

Organisation-level role names can be customised per organisation in the organisation settings.