Repository navigation
v1.3.0 — Custom admin roles, policies & groups
What's new
Admin access control is now data, not a hardcoded list.
- Editable roles and policies. The console ships a fixed capability catalogue (monitoring, network, directory, rules, system, backups, and reserved access-control/security/maintenance capabilities). Create custom roles and assign each admin exactly one role.
- Built-in roles are editable in place.
adminandauditorcan be renamed, re-described, and given a different permission policy; every admin assigned to them picks up the change on their next request — no re-invite or reassignment.super_adminremains locked to full access as the break-glass role. - Custom roles cannot take reserved capabilities. Access control, security policy, audit purge, and maintenance stay super-admin-only.
- Admin groups. Groups are organizational only: they make the admin list filterable and support bulk role assignment for every member. Each admin can belong to many groups. Invite forms accept groups, and the admin list shows group chips and a group filter.
- Permission-aware console. API routes are guarded by capabilities, and the UI filters navigation and write actions accordingly. Existing
adminusers keep their operational access;auditorbecomes genuinely read-only instead of having no usable routes. - MFA and audit coverage. Role creation/editing/deletion and bulk group role assignment require a fresh MFA step-up. Role and group changes are audited, and last-super-admin guards prevent lockouts.
Safer admin account changes
- Changing an admin's email now resets the passkeys bound to that account. The console warns first and requires an explicit confirmation before any MFA step-up is consumed; the email change and WebAuthn reset are atomic. Authenticator-app codes and recovery codes keep working, and other sessions are signed out.
- Added guards against deleting the last active super admin or deleting your own admin account.
Upgrade notes
- No manual database steps. Migration 030 is additive and idempotent and applies automatically on the next API start. It seeds the three built-in roles, replaces the old three-value role check with a foreign key, and creates the admin-group tables.
- Existing admins keep their current role slug. Policy edits made later are preserved across restarts and upgrades.
- Admin email changes are now a passkey-reset action. If SMTP/email changes are part of your workflow, expect the explicit confirmation prompt and re-enrollment of passkeys; TOTP and recovery codes are unaffected.
Verification
- Backend:
go build ./...,go vet ./..., andgo test ./...green. - Migration 030 applied twice against a temporary PostgreSQL 18 cluster; schema, seeded policies, and the
admins.roleforeign key verified. - Frontend: 36 test files / 266 tests green,
tscclean, production Vite build clean. - New tests cover the capability catalogue/canonicalisation, permission middleware, role creation, group creation, MFA-gated bulk role assignment, permission filtering, and the admin email/passkey-reset flow.