Context
Brief §5.6.3 requires RBAC separating admin, editor and standard users; brief §10 requires least-privilege authorisation. Editorial curation (M7) has been running on interim role checks — this issue formalises the model before the full admin CMS opens more powerful surfaces.
Scope
- Role model:
user (default), editor (catalogue curation, editorial collections, lyrics authoring), admin (everything + user management, moderation queue, licences, config); permission matrix documented in docs/security/RBAC.md and encoded as typed permission constants — checks reference permissions, never role names.
- Enforcement: tRPC middleware guard per procedure (deny-by-default for any procedure without an explicit permission annotation — CI check enforces annotation presence), plus route-level guards on admin UI surfaces; WS topics and REST endpoints covered equally.
- Administration: role assignment UI/API (admin-only, step-up MFA, audited), no self-demotion of the last admin, invitation flow for editors.
- Audit: every privileged action writes
audit_log (actor, permission, target, before/after summary — no PII bloat).
Acceptance criteria
Technical notes
Keep it roles→permissions only — no per-object ACLs yet; playlist collaborator rights remain the domain model's concern, not RBAC's.
Dependencies
Depends on #19. Blocks #58, #61.
Context
Brief §5.6.3 requires RBAC separating admin, editor and standard users; brief §10 requires least-privilege authorisation. Editorial curation (M7) has been running on interim role checks — this issue formalises the model before the full admin CMS opens more powerful surfaces.
Scope
user(default),editor(catalogue curation, editorial collections, lyrics authoring),admin(everything + user management, moderation queue, licences, config); permission matrix documented indocs/security/RBAC.mdand encoded as typed permission constants — checks reference permissions, never role names.audit_log(actor, permission, target, before/after summary — no PII bloat).Acceptance criteria
Technical notes
Keep it roles→permissions only — no per-object ACLs yet; playlist collaborator rights remain the domain model's concern, not RBAC's.
Dependencies
Depends on #19. Blocks #58, #61.