Skip to content

Permissions

Every user has two independent attributes:

  1. job_role (DM / DL / TL) - Determines which scorecard template and onboarding items apply
  2. access_level (Executive / Head / Manager / Lead / Employee) - Determines what you can see and do
LevelDescriptionData Scope
ExecutiveFull access + adminAll data
HeadCross-team visibilityAll data
ManagerTeam-level accessOwn + squad data
LeadIndividual accessOwn data
EmployeeIndividual accessOwn data

Stored in the tool_permissions table, configurable via the Admin section (Executive only).

Each tool × access level combination has three permission flags:

  • can_view - Can see the tool and its data
  • can_update - Can modify data (create, edit, delete)
  • can_manage - Can configure the tool itself (edit templates, phases, etc.)

Squad membership determines the “own + squad” scope for Managers:

  • own: Only the current user’s data (Lead, Employee)
  • own + squad: Own data + data from users in squads where is_manager = 1 (Manager)
  • all: All users’ data across all squads (Head, Executive)
  1. API middleware (worker/middleware/permissions.ts): Checks tool permissions before request processing
  2. Route handlers: Scope DB queries based on access level
  3. Frontend: useAuth() exposes canView(), canUpdate(), canManage() helpers
  4. Sidebar: Only shows tools the user has can_view for
  5. UI controls: Edit buttons hidden without can_update, config hidden without can_manage