Issue 520
Rename the default account role to guest; keep resident for verified addresses
Back to our planDone
enhancementauthpriority: medium
Summary
Every new account is labelled "resident" today, but nobody has checked that the person lives in Sprecher East. The owner wants that word to mean a verified neighbour. New accounts become guest, and resident is given only once an address has been verified (#314).
Details
Summary of the owner's decision (2026-10-31, voice session with Claude): the default role should be guest, and the roles are guest, resident and admin. Editor keeps its current name, and the contributor role is removed. The agent role stays.
| Role | Meaning |
|---|---|
guest | New default. Has an account; address not verified. Same access as resident has today. |
resident | Address verified (#314 decides how). |
editor | Unchanged: adds and edits content, uses the admin. |
admin | Unchanged: runs the site. |
agent | Unchanged: the intelligence agents' MCP accounts (#336). |
- Migration: every existing
residentaccount becomesguest, since none has had its address verified. A migration does it, with a workingdown. - Where it changes:
ROLESandRole(src/platform/lib/roles.ts), the users collection'srolefield and default,roles.tsaccess checks, sign-up (always creates aguest), tests, the access-policy table, and the docs that name the roles (docs/guidelines/security.md,docs/project.md, the glossary and data model).security.mdis a policy path; this issue quotes the owner. - Not in scope: the residency check itself and anything only verified residents may do (#314). Until #314 ships,
guestandresidenthave the same access. - Ride-along: #354 (the first account on an empty site becomes
admin) fits in the same PR, as discussed with the owner.
Acceptance criteria
- A new sign-up is a
guest; no code path creates aresidentexcept an admin setting it. - Existing
residentaccounts areguestafter the migration, anddownrestores them. - Only admins can change a role, as today; tests prove a guest can't set its own role.
- The first account created on an empty database is an
admin(#354). accessPolicy.test.ts, the role tests and the docs are updated, and nothing else's access changes.
Generated by Claude Code, opens in a new tab