How One Developer Built Simple Family Account Switching Without Full Permissions System
A developer building MyVitals, a household lab-report management app, chose a lightweight account-delegation model over a full role-based access control system. The solution uses a FamilyMember database record that transitions from a pending invite to an accepted membership, with a sparse unique index trick to prevent duplicate-key errors on invite tokens. Access checks run as a live database read on every request rather than being cached, ensuring that revoking a family member's access takes effect immediately. The acting user's identity is tracked separately from the effective user ID in each request, though the developer acknowledges this relies on convention and code review rather than type enforcement. The all-or-nothing, symmetric access model is intentionally simple and designed to be replaced rather than extended if more granular permissions are ever needed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in