Functional contract

RBAC

Who may do what, and where. The role and action catalog is global, owned by SuperUsers. Organization, Location group, and Location administrators only assign or revoke those roles on Staff.

Catalog and assignment shipped Location-group-scoped roles shipped (Elite) Location switcher shipped Updated 3 Nov 2026

Catalog vs assignment

LayerWhoWhat
CatalogSuperUser at /admin/roles and /admin/actionsCRUD roles, CRUD actions, attach/detach actions on a role
AssignmentOrganization, Location group, 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. Impersonation from /admin/users uses the target User's Staff RBAC; it grants no elevated rights.

Model

RbacAction (global key, resource, verb, scope, system) Role (global key, scope organization|location|location_group, system) └── RoleAction Staff (User + Organization) └── StaffRoleAssignment (role, optional location or location group)
Role scopeTargetApplies at
organizationlocation_id nilEvery Location in the Organization
locationA Location in the OrganizationThat Location only
location_groupA Location Group (location_group_id, Elite only)Every Location currently in the group, including ones added later

Rbac.sync! (Rbac::Catalog) seeds the catalog. Organization.provision! assigns the founder org-wide Organization administrator.

Who may assign

ActorMay
SuperUserMutate the catalog only. Not clinic staff
Organization administratorAny role on any Staff (org-wide, any group, any Location). Invite, resend, withdraw, disable/enable. Cannot open /admin
Location group administratorLocation-scoped roles at every Location of their group, and the Location group administrator role on that group. No org-scoped roles or other groups. Cannot invite, resend, withdraw, or disable
Location administratorLocation-scoped roles only, at Locations they admin. Cannot invite, resend, withdraw, or disable
Everyone elseNo assignment UI

The last Organization administrator assignment in an Organization cannot be removed.

Action keys

ScopeActions
Organizationorganization.manage, catalog.manage (master items, pricing groups, patient groups, locks), appointmenttypes.manage, taxes.manage (taxes and tax groups), reports.organization, commissiongroups.manage
Bothstaff.roles.assign, catalog.read, appointmenttypes.read, taxes.read, locations.read, reports.read, settings.manage
Location grouplocationgroups.manage: group profile (name, code, description); group catalog, price, patient group, and tax overrides and locks; exclusive-item grants; group-owned patient groups, taxes, tax groups, and commission groups (including staff on those commission groups). Membership stays with organization.manage
Locationcatalog.override (unlocked item, price, and patient group overrides), appointmenttypes.override, taxes.override, locations.manage, patients.*, appointments.*, visits.*, soap.manage, inventory.*, billing.*, checkout.*, invoices.*, payments.*, tips.*, commissions.* (each .read / .manage)

Clinic invoices use invoices.*; SaaS Settings billing keeps billing.*. Tips: Clinic tips. Commissions: Commissions.

Default roles

RoleScopeGrants
Organization administratorOrganizationAll tenant actions, including staff.roles.assign
Location group administratorLocation groupEvery Location administrator action at each member Location, plus locationgroups.manage. Settings pages filter to their groups
Location administratorLocationSite operations, staff.roles.assign (location-scoped only), catalog.read / catalog.override, appointmenttypes.read / .override, taxes.read / taxes.override, soap.manage, checkout.*, invoices.*, payments.*, tips.*, commissions.*
ReceptionistLocationAppointments, appointmenttypes.read, taxes.read, visits, patients.*, billing, checkout.*, invoices.*, payments.*, tips.read, commissions.read, reports.read
VeterinarianLocationpatients.*, appointments.read, appointmenttypes.read, taxes.read, visits.*, soap.manage, catalog.read, inventory.read, checkout.read, invoices.read, payments.read

Authorization helpers

AreaHelpers
Coreallowed_to?(key) (no location = org-wide only), allowed_to?(key, location:), granted_locations
Schedule / whiteboardmay_read_appointments_at? / may_manage_appointments_at?; may_read_visits_at? / may_manage_visits_at?; sidebar uses the non-_at variants
Patients, diagnosticsmay_read_patients? / may_manage_patients?; diagnostic orders reuse soap.manage and patients.read
Catalogmay_read_catalog?, may_manage_catalog?, may_override_catalog_at?; Catalog::ItemPolicy (items, grants, locks), Catalog::PricingPolicy (prices, patient groups)
Taxesmay_read_taxes?, may_manage_taxes?, may_override_taxes_at?
Location groupsmay_manage_location_group?; group-owned records use may_manage_owned? (org permission, or locationgroups.manage on the owner)
Commissionsmay_manage_commission_groups?
Inventory, checkout, invoices, tipsmay_read_*_at? / may_manage_*_at?; sidebar links use may_read_*?
Settingscan_view_settings?; Users & Roles uses can_assign_roles? and may_assign?

Acceptance

Access rules: Staff access. Out of scope: role hierarchy, invite email, SSO, seat caps, SuperUser elevated workspace.