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 assignments.

Founder Staff, RBAC, invite, and Location switcher shipped Invite email not built

Membership

FactRule
Organization membershipA Staff record links a User to exactly one Organization. A User may have 0..N Staff records
InviteOrganization administrators invite by name and email. New emails create a User; existing emails reuse the login. Staff stays pending until the address is validated
Pending membershipaccepted_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 invitationOrganization administrators resend a pending invite (PATCH /app/staffs/:id/resend). Rotates the token and increments the send count. Delivery is not built
Withdraw invitationOrganization administrators withdraw a pending invite. Destroys the Staff. The User login is unchanged
Disabled membershipdisabled_at set. Same access denial as pending. The User login stays usable. Last enabled Organization administrator cannot be disabled
SettingsStaff#can_view_settings? (Organization administrator, Organization manager, Location administrator). Users & Roles tab only if can_assign_roles?
Location grantsLocation-scoped role assignments. Organization-scoped assignments imply every Location
Current LocationWorkspace scoped to one granted Location (or Organization overview). Sidebar switcher when the Staff has more than one Location; PATCH /app/workspace stores the choice
SuperUserNot Organization staff. May impersonate a staff User from /admin/users and work in /app with that User’s Staff, workspace, and RBAC. SuperUser session stays. Stop at DELETE /admin/impersonation or /app sign-out. No UserSession, no login-stat update. API impersonation is not built
CustomerLater. A User may associate with one or more Customers without a Staff record

Organization-scoped roles may use every Location. Catalog definition is SuperUser-only. See RBAC.

Roles

RoleScopeMay
Organization administratorWhole OrganizationAssign any role, master catalog, all Locations, consolidated reports
Organization managerWhole OrganizationOrg-wide read and consolidated reports. Cannot assign roles
Location administratorAssigned LocationsSite ops and assigning location-scoped roles there. Cannot assign org-scoped roles
ReceptionistAssigned LocationsScheduling, visits/check-in, patient admission, checkout
VeterinarianAssigned LocationsMedical records (SOAP), visits, appointments as provider (read)

A person can be Organization administrator and also a veterinarian at granted Locations. Location 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. The membership is listed as Pending, with days since the last send and how many times the invite was issued. Roles may be assigned before validation. A pending invite can be resent (PATCH /app/staffs/:id/resend) or withdrawn (DELETE /app/staffs/:id); withdraw deletes the membership only. Until Staff#accept!, that membership grants no access. Founder provision sets accepted_at. Invite email delivery and the accept-by-token page are not built.

Disable staff

Organization administrators disable an accepted membership (PATCH /app/staffs/:id/disable, disabled_at). Disabled Staff cannot act, are not bookable, and are omitted from User#primary_staff. Enable restores the same membership. The User record is never changed. The last enabled Organization administrator cannot be disabled.

Location switcher

Reports and data visibility

ViewerSees
Organization administrator / managerOrganization totals, each Legal Entity, each Location
Location rolesOnly granted Locations
SuperUserAll tenants, for support

Catalog rights

Details: Catalog and pricing.

Acceptance