Unknown users get the least access, not the most

Anyone signed in without an explicit role is treated as a worker, and the UI waits for the role to load before deciding what to show.

What it is

The client resolves role from account metadata and falls back to worker. The role context exposes an isLoaded flag so nav and tab gates do not render the wrong screen during the moment before the identity provider hydrates.

Also called: default role · new user sees everything · signed in and saw the whole app

See it
Unknown users get the least access, not the most
Area
Platform & Admin
Group
Roles & permissions
System
Team & Access
Solves
2 named problems
01getRoleFromClerk defaults to worker when metadata carries no role.
02The deprecated localStorage role mirror also defaults to worker.
03RoleContext exposes isLoaded; the settings deep-link guard only acts once the role is loaded, so a real admin is never bounced mid-load.
Not visual — show the nav rendering as worker while loading, then expanding once the admin role resolves. Sample data — no customer information appears here.
How it works
  1. 1getRoleFromClerk defaults to worker when metadata carries no role.
  2. 2The deprecated localStorage role mirror also defaults to worker.
  3. 3RoleContext exposes isLoaded; the settings deep-link guard only acts once the role is loaded, so a real admin is never bounced mid-load.
Why we built it

Both files record the same incident. roles.ts: 'Defaulting to admin here let any signed-in user with unset metadata see every nav tab, even though the server-side requireRole guards would 403 their actual data queries — the visible effect was I can see Sales Pipeline but it's empty (Danny's bug).' permissions.ts adds the mobile variant: an invitee with no localStorage state saw every nav tab even though their server-side role was worker.

The problem
  • A missing role granted full navigation.
  • Nav rendered against a placeholder role during hydration.
Sound familiar?
What you get
A misconfigured or half-onboarded account cannot see more than a worker.
No flash of the wrong menu on load.

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →