Skip to content
SprecherEast
Issue 520

Rename the default account role to guest; keep resident for verified addresses

Back to our plan
Done
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.

RoleMeaning
guestNew default. Has an account; address not verified. Same access as resident has today.
residentAddress verified (#314 decides how).
editorUnchanged: adds and edits content, uses the admin.
adminUnchanged: runs the site.
agentUnchanged: the intelligence agents' MCP accounts (#336).
  • Migration: every existing resident account becomes guest, since none has had its address verified. A migration does it, with a working down.
  • Where it changes: ROLES and Role (src/platform/lib/roles.ts), the users collection's role field and default, roles.ts access checks, sign-up (always creates a guest), 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.md is 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, guest and resident have 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 a resident except an admin setting it.
  • Existing resident accounts are guest after the migration, and down restores 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

See it on GitHub, opens in a new tab