Implement multi-user roles and review attribution #22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
UserRoleexists andrequire_roleguards routes, but the app is effectivelysingle-user: there is no user management, and decisions and comments are not surfaced
with their author. Phase 2 is where multiple family members review together, and shared
review without attribution makes disagreements impossible to trace.
Scope
Role management and visible attribution across the review surfaces.
Implementation notes
and document exactly what each may do. Ambiguity here becomes an authorization bug later.
is v0.4.0; this is the minimum needed for a working multi-user deployment.
row. The data is already there —
created_byis populated — it just is not surfaced.append-only; removing a person cannot rewrite what they decided.
Done when
References
backend/app/models/models.py(UserRole,created_byfields)backend/app/auth/session.py(require_role)docs/circa-spec.mdPhase 2Related: #8 (authorization tests).
Amended by the audit of 2026-07-28.
The current default role is a live vulnerability, not just future work (#56).
User.roledefaults to
UserRole.reviewerandupsert_from_providerpasses no role — so every account thatcompletes OAuth gets write access to the entire collection, with no allowlist and no approval step.
reviewercan also reachPOST /api/ingest, which is the arbitrary-write primitive in #55.That fix belongs in v0.1.1 (#56), ahead of this issue.
Two further splits:
soon as a second person touches the collection. It also removes the UUID disclosure that #57
requires anyway.
_ADMINis definedand never used), the
viewerrole is unreachable, and/api/ingest's docstring says"Admin-only in Phase 1" while the code enforces reviewer.