Appearance
ADR 0007: Role model
- Status: Accepted
- Date: 2026-11-18
- Spec version: 1.0.0
Context
Seven roles in the spec: Owner, Manager, Sales, Videographer, Editor, Client Admin, Client Member. Client Admin and Member always belong to one client business; the others never do.
Decision
user.role(Better Auth admin plugin) is one of six values:owner | manager | sales | videographer | editor | client.- A client business is a Better Auth organization. Org role
owner= Client Admin;member= Client Member. No custom org roles yet. - Web spaces group roles:
owner(owner, manager),sales,crew(videographer, editor),client.roleSpace()in@shootgrow/domainis the single mapping. - Admin-plugin permissions (
packages/auth/src/permissions.ts) guard only the plugin's own endpoints. Business access ispackages/api/src/access.ts. - The Manager role exists and is gated by the setting
access.managerRoleEnabled(default off), per open decision 7. - No public sign-up. Staff are created by the owner; clients on conversion.
Consequences
- "Is this a Client Admin?" is not
user.role.ActorcarriesorganizationId; a procedure that needs the answer callsclientScope(db, actor)(packages/api/src/scope.ts), which loads the login and returnskind: "admin" | "member". - A user with a role the build does not know is treated as signed out in the web app and
FORBIDDENin the API.
Revisit when
A person needs two roles at once (for example a salesperson who is also an editor): then roles become a set, not a single value.