Skip to content

Roles & Permissions

The seven user roles in Kagami and what each can access.

8 min read

Role Model

Kagami has seven roles arranged in a hierarchy. Every user has exactly one role within a given context (location or brand). Access is enforced in two layers: Row-Level Security in the database, and role checks in server pages and server actions (lib/auth). Many server helpers use the service-role client, which bypasses RLS, so for those the server-side role check is the real gate. Never rely on the UI hiding a button.

Kagami role-based access control RBAC matrix with granular security permissions for salon staff

Role Scope Description
super_admin Platform Platform operators. Access to all tenants for support. Not visible to salons.
org_owner Org The business owner. Full access across all brands and locations they own.
brand_manager Brand Manages one brand: configures services, pricing, staff, and policies across all of the brand's locations.
location_manager Location Runs day-to-day operations at one location. Full operational access, limited configuration access.
front_desk Location Books appointments, manages walk-ins, processes checkout, manages clients.
stylist Location Views own calendar and client history. May add notes. Limited booking self-service (configurable).
client Brand Accesses client-facing surfaces: booking, portal, check-in, feedback. Never accesses the operator dashboard.

How Access Is Decided

Three mechanisms work together:

  1. Role groups (lib/auth/types.ts) used by requireRole-style checks on pages and actions. Most staff, payroll, attendance and day open/close actions are manager-only.
  2. Page permissions: every sidebar page has a default set of roles (lib/nav/sections.ts). An owner can switch a page on or off per role in Settings > Roles & permissions (owner / super admin only). Overrides are stored per organisation in role_permissions; with no override the page's default roles apply. super_admin always passes.
  3. Action permissions (lib/auth/permissions.ts): finer toggles that are not pages, for example billing.create, billing.void, bookings.cancel, clients.create / edit / delete / merge, services.*, products.*, inventory.*, staff.create / edit / delete, tasks.manage, expenses.create / approve, marketing.*, memberships.plans, packages.manage, wallets.add_money, dashboard.revenue and scheduling.book_all_staff. Most default to the manager roles; bookings.cancel, clients.create and tasks.manage default to every role. Checked server-side with canRole / callerCan / requireCallerPermission.

The tables below summarise the defaults; they are not the source of truth. The authoritative lists are ROLE_PERMISSIONS in lib/auth/permissions.ts and the roles on each item in lib/nav/sections.ts. "Managers" means org_owner, brand_manager and location_manager.

Manager-only areas

Area Who Notes
Payroll (generate, finalize, LOP, statutory settings) Managers Page and every action check the manager roles
Commission rules, targets, attendance records Managers Page is managers only; the underlying actions also accept front desk but nothing in the UI uses that
Exceptions page (/dashboard/exceptions) Managers Others are redirected to /dashboard
Open / close salon, reopen day (/dashboard/open-close) Managers The page is visible to every role, but opening, closing and reopening are manager-only; others see a reduced view without sales or cash figures
"Require open day before billing" switch Owner / super admin only Brand-wide, can stop billing at every store
Cash Register (/dashboard/cash) Managers by default Front desk / stylist only if an owner turns "Cash Register" on
Late cash count on an auto-closed drawer Managers Always, even if Cash Register is granted to others
Staff "require selfie for clock-in" Owner / super admin only
Roles & permissions page, API keys, brand profile, custom domain, wallet rules Owner / super admin only OWNER_ROLES

Permission Matrix

Summary of default behaviour. Rows touching billing, cash, staff, payroll, marketing and settings were checked against the code; the rest are indicative.

Scheduling

Capability org_owner brand_manager location_manager front_desk stylist
View all staff calendars Yes Yes (brand) Yes Yes Own day only
Create/edit appointments Yes Yes Yes Yes Own, if enabled
Cancel / no-show Yes Yes Yes Yes Own, if enabled
Manage walk-in queue Yes Yes Yes Yes View/claim
Create non-bookable blocks Yes Yes Yes Limited No
Override conflict/shift Yes Yes Yes If granted No
Configure scheduling settings Yes Brand level Location subset No No

Client CRM

Capability org_owner brand_manager location_manager front_desk stylist
Create and edit clients Yes Yes Yes Yes Notes only
View full client history Yes Yes Yes Yes Yes (service-relevant)
Capture / withdraw consent Yes Yes Yes Yes No
Add shared notes Yes Yes Yes Yes Yes
Add private notes Yes Yes Yes If configured Author only
Manage tags and segment rules Yes Yes (brand) Tags only Tags only No
Merge duplicates Yes Yes Yes Flag only No
Handle data-subject requests Yes Yes Limited No No

Checkout & Finance

Capability org_owner brand_manager location_manager front_desk stylist
Process checkout (billing.create) Yes Yes Yes If granted No
Apply discounts / override price Yes Yes Yes If granted No
Issue refunds Yes Yes Yes If granted No
View invoices Yes Yes Yes Yes Own services
Cash drawer open/close Yes Yes Yes If granted If granted
View financial reports Yes Yes Yes No No
Manage expenses and vendors Yes Yes Yes No No
Approve / reject expenses (expenses.approve) Yes No No No No
Void a bill (billing.void) Yes Yes Yes If granted No
Configure commission rules and targets Yes Yes Yes No No

Staff Management

Capability org_owner brand_manager location_manager front_desk stylist
Create / edit staff profiles Yes Yes Yes No No
Manage shifts and schedules Yes Yes Yes No (page hidden) No
Approve / deny leave requests Yes Yes Yes No No
View attendance records Yes Yes Yes No No (own clock card in /my only)
Set performance goals and commission targets Yes Yes Yes No No
Run payroll Yes Yes Yes No No
Create / delete tasks (tasks.manage) Yes Yes Yes Yes Yes

Marketing & Retention

Capability org_owner brand_manager location_manager front_desk stylist
Create and send campaigns Yes Yes Yes No No
Manage loyalty and memberships Yes Yes Yes View/redeem No
Issue gift cards Yes Yes Yes No No
Manage segments and journeys Yes Yes No No No
Configure review requests Yes Yes Yes No No

Settings & Configuration

Capability org_owner brand_manager location_manager front_desk stylist
Edit brand name, logo, colors Yes No No No No
Manage service catalog Yes Yes Yes No No
Configure integrations Yes Yes No No No
Send staff invitations Yes Yes Yes No No
Change role permissions (Roles & permissions page) Yes No No No No
Configure SaaS billing Yes No No No No

Role Assignment

Roles are assigned when inviting a staff member:

  1. A manager (org owner, brand manager or location manager) creates an invitation for a staff member; the role and scope come from the staff member's staff role.
  2. The invitee receives a link to set up their account.
  3. The role and scope (org / brand / location) are stored as a row in memberships linking the user, role, and scope.

A user can hold different roles at different locations (e.g., location_manager at Location A and front_desk at Location B) but this requires a separate membership row for each location.

Client Accounts

Clients are a separate user type. They authenticate through client-facing surfaces (booking page, portal) and never see the operator dashboard. Their permissions are limited to:

  • Viewing and editing their own contact details and preferences
  • Capturing or withdrawing their own consent
  • Viewing their own booking history
  • Submitting intake forms, consent waivers, and feedback

Super Admin

The super_admin role belongs to Kagami platform operators, not salon staff. It allows:

  • Viewing the Platform Overview dashboard (/dashboard/super-admin) — all-tenant KPIs, tenant list
  • Viewing any tenant and previewing the app as another role for support (impersonation)
  • Managing subscription plans and billing
  • Running data exports and migrations
  • Handling platform-level incidents

Super-admin access is logged in the audit trail and never exposed to tenant users.

Server-Side Role Enforcement (RBAC Middleware)

Role-gating is centralised in lib/auth/require-role.ts. Any server component or server action can call one of three helpers:

await requireRole(["super_admin"])           // exact role list
await requireAnyAdmin()                       // ADMIN_ROLES: location_manager and above
await requireManagerOrAbove()                 // MANAGER_ROLES: same four roles as ADMIN_ROLES
await requireRoleForPage(MANAGER_ROLES)       // returns null instead of redirecting

The helpers read the caller's role from the database (via getCallerRole(), which also honours a super admin's role preview) — they never trust client-supplied values. An unauthenticated request redirects to /sign-in; an insufficient role redirects to /dashboard. requireRoleForPage returns null on a role mismatch so a page can render a permission-denied state instead of redirecting. Server actions use requireCallerRole(roles) and return an error message instead of redirecting.

Role group constants live in lib/auth/types.ts:

Constant Roles
ALL_ROLES super_admin → stylist (does not include client)
OPS_ROLES super_admin → front_desk
ADMIN_ROLES super_admin → location_manager
MANAGER_ROLES super_admin → location_manager (identical to ADMIN_ROLES)
OWNER_ROLES super_admin, org_owner
SUPER_ADMIN_ONLY super_admin