Users belong to one or more groups stored in Postgres: typically default registered users, paying members with CSV access, and admins who review contact submissions. Server routes check group membership before unlocking CSV export or admin dashboard tools rather than scattering email allowlists in code.
Common groups
- default: signed-in feeds and history browsing.
- member: active Stripe subscription for CSV.
- admin: user lookup and contact review.
Enforcement points
Check groups in Astro middleware and API handlers: middleware patterns. Webhooks add member group on successful checkout; cancellations remove it. Never trust client-side group claims.
Auth foundation
Registration, described in the sign-in flow, assigns the default group. The session cookie only identifies the user; server routes look up their groups in Postgres. See session lifecycle.
FAQ
What is the difference between editor and view-only?
Editors can change devices, alerts, and sharing. View-only members watch live data and history without changing household configuration.