Functional contract

RBAC

The role and action catalog is global, owned by SuperUsers. Organization and Location administrators only assign or revoke those roles on Staff.

Catalog and assignment shipped Location switcher shipped

Catalog vs assignment

LayerWhoWhat
CatalogSuperUser at /admin/roles and /admin/actionsCRUD roles, CRUD actions, attach/detach actions on a role
AssignmentOrganization and Location administrators at /app/settings?tab=users (GET /app/staffs redirects)Assign or revoke catalog roles on Staff
InviteOrganization administrator at the same tab (POST /app/staffs)Create a pending Staff (and a User when the email is new). Resend or withdraw pending invites. Disable/enable memberships without changing the User

Tenants never mutate the catalog. SuperUsers are gated by session, not by a tenant action key. Impersonating a staff User from /admin/users uses that User’s Staff RBAC; it does not grant catalog or elevated tenant rights.

Model

RbacAction (global key, resource, verb, scope, system) Role (global key, scope organization|location, system) └── RoleAction Staff (User + Organization) └── StaffRoleAssignment (role, optional location)

Rbac.sync! seeds the catalog. Organization.provision! assigns the founder org-wide Organization administrator.

Who may assign

ActorMay
SuperUserMutate the catalog only
Organization administratorAssign or revoke any catalog role in the Organization. Invite, resend, withdraw, disable/enable staff
Location administratorLocation-scoped roles only, at Locations they admin. Cannot assign org-scoped roles. Cannot invite, resend, withdraw, or disable
Everyone elseNo assignment UI

The last Organization administrator in an org cannot be removed.

Default roles

RoleScopeGrants
Organization administratorOrganizationAll tenant actions, including staff.roles.assign
Organization managerOrganizationOrg-wide reads and reports.organization
Location administratorLocationSite ops, catalog.override, soap.manage, location-scoped role assignment
ReceptionistLocationAppointments, visits, patients, billing, reports.read (SOAP read only)
VeterinarianLocationpatients.manage, appointments.read, visits, soap.manage, catalog.read, inventory.read

Location-scoped actions include patients.*, appointments.*, visits.*, soap.manage, inventory.*, billing.*, checkout.*, invoices.*. Clinic invoices use invoices.*; SaaS Settings billing keeps billing.*. Full action list and acceptance: docs/functional/rbac.md. Access rules: Staff access.