Functional contract
Staff access
A User is an independent login. Access to an Organization is a Staff record. What the person may do is a role assignment. Location grants are location-scoped (or Location-Group-scoped) assignments. One login covers every assigned site.
Membership
| Fact | Rule |
|---|---|
| Organization membership | A Staff record links a User to exactly one Organization. A User may have 0..N Staff records |
| Invite | Organization administrators invite by name and email at /app/settings?tab=users. New emails create a User; existing emails reuse the login. Staff stays pending until the address is validated |
| Pending membership | accepted_at blank. No org access. User#primary_staff ignores pending records. Users & Roles shows days since last send and how many times the invite was issued |
| Resend invitation | PATCH /app/staffs/:id/resend. Rotates the token and increments the send count. Delivery is not built |
| Withdraw invitation | DELETE /app/staffs/:id. Destroys the Staff and its assignments. The User login is unchanged |
| Disabled membership | disabled_at set. Same denial as pending. The User and other memberships stay usable. Last enabled Organization administrator cannot be disabled |
| Settings | Staff#can_view_settings?: Organization administrator, Location administrator, Location group administrator. Users & Roles tab only if can_assign_roles? |
| Location grants | Location-scoped assignments, plus Location group administrator assignments (every Location in the group). Organization-scoped assignments imply every Location. Staff#granted_locations is the list |
| Current Location | One granted Location at a time (or Organization overview), stored in the session. Sidebar switcher when the Staff has more than one grant; PATCH /app/workspace |
| SuperUser | Not Organization staff. May impersonate a staff User from /admin/users and work in /app with that User's Staff, workspace, and RBAC. Stop at DELETE /admin/impersonation or /app sign-out. No UserSession, no login-stat update. API impersonation is not built |
| Customer | Later. A User may associate with Customers without a Staff record |
Staff with no Location assignment cannot operate clinic workflows, except organization-scoped roles, which may use every Location. See RBAC.
Roles
The role catalog is global (SuperUser at /admin). Organization, Location group, and Location administrators only assign or revoke roles at /app/settings?tab=users.
| Role | Scope | May |
|---|---|---|
| Organization administrator | Whole Organization | Assign any role, master catalog, Legal Entities, all Locations, all Users, consolidated reports, billing settings |
| Location group administrator | Every Location of the assigned Location Group | Location administrator at each member Location, plus group settings: profile; catalog, price, patient group, and tax overrides and locks; catalog grants; the group's patient groups, taxes, tax groups, and commission groups. Assigns location-scoped roles at member Locations and this role on that group. Cannot change membership, other groups, or the master catalog |
| Location administrator | Assigned Locations | Site ops and assigning location-scoped roles there. Cannot see other sites' drawers, invoices, or stock, edit the master catalog, or assign org-scoped roles |
| Receptionist | Assigned Locations | Scheduling, checkout, client communication, patient admission |
| Veterinarian | Assigned Locations | Medical records, orders, appointments as provider |
- A person can be Organization administrator and also a veterinarian at granted Locations.
- Location administrators may hold several sites (regional manager) without becoming Organization administrator.
- Location and Location group administrators cannot invite, resend, withdraw, or disable staff.
Invites
Organization administrators invite from Users & Roles (Staff.invite! / POST /app/staffs): first name, last name, email. Listed as Pending with days since last send and send count. Roles may be assigned before validation. Resend (Staff#resend!) or withdraw (Staff#withdraw!; deletes the membership only). Until Staff#accept!, no access. Founder provision sets accepted_at.
/register or log in until that flow exists.Disable staff
Organization administrators disable an accepted membership (PATCH /app/staffs/:id/disable). Disabled Staff cannot act, are not bookable, and are omitted from User#primary_staff and API session organizations. Enable restores the same membership and roles. The User is never changed. The last enabled Organization administrator cannot be disabled.
Location switcher
- Lists granted Locations (
Staff#granted_locations), plus the Organization when there is more than one grant. Group roles show as member Locations; there is no group workspace. - Switching keeps the same session and patient database (
PATCH /app/workspace). Schedule and stock follow the new Location. - Hidden when the User has exactly one grant.
- Organization scope shows Home and Schedule as placeholders.
Reports and data visibility
| Viewer | Sees |
|---|---|
| Organization administrator / manager | Organization totals, each Legal Entity, each Location |
| Location roles (including group administrators) | Only granted Locations. No other site's revenue, drawer, or on-hand |
| SuperUser | All tenants, for support |
Outstanding-balance alerts from another site are visible at checkout; collecting that invoice happens in the other Location's context (Billing).
Catalog rights
- Only Organization administrators edit the master catalog and lock items.
- Location administrators override unlocked attributes at granted Locations.
- Location group administrators override unlocked attributes for their group and its Locations, lock them for the group's Locations, and grant items within the group unless grants are locked.
- Location-exclusive items exist only if the Organization policy allows them.
Details: Catalog and pricing.
Acceptance
- A veterinarian granted A and B logs in once and switches without a second user. Granted only A, they cannot open B by URL or API.
- An Organization administrator can open every Location.
- A Location administrator at A cannot assign Organization administrator, change master prices, or see B's daily close.
- Removing an assignment immediately drops that site from the switcher and authorization.
- SuperUsers authenticate only at
/admin/login; impersonation sees/appas that person and stopping returns to/admin/users. - Pending Staff cannot operate until accepted. Users & Roles shows days since last send and send count; resend or withdraw does not delete the User.
- Disabling a Staff membership leaves the User login unchanged. The last enabled Organization administrator cannot be disabled.
- A Location administrator cannot invite, resend, withdraw, or disable staff.
Out of scope: invite email and accept-by-token, SSO, plan-based seat caps.