Profile-only access for zero-role users
Status
Section titled “Status”Accepted.
2026-09-11.
Context
Section titled “Context”A user can authenticate successfully and still hold no platform role. This happens routinely: a federated user from an unmapped role set, a portal-adjacent account, or a user whose roles were removed. Before this change, such a user could open the dashboard, about ten endpoints leaked data, and a zero-role anchor user passed most checks because the anchor tier short-circuits permission checks.
The per-handler permission checks left gaps: some /bff lookups were ungated, and anchor users bypassed per-permission checks entirely.
Decision
Section titled “Decision”A USER principal who holds no platform role, and therefore no permission, is confined to their own profile.
- A middleware (
ProfileOnlyWithoutRole) is mounted immediately after authentication, covering every route in the authenticated group. Anything outside the self-service allowlist answers403 NO_PLATFORM_ROLE(“Your account has no platform access. Only your profile is available.”). - Unauthenticated requests pass untouched, since the same group hosts public login flows. Service accounts pass too: application service accounts authorise through their
applicationsclaim, not through roles. - The console shows only the profile to such a user.
- The rule holds regardless of tier. A zero-role anchor user is confined exactly like any other.
Related access-gate rules from the same work: a portal login through an app-linked OAuth client requires that app’s grant (403 NO_PORTAL_ACCESS, checked after the password so it reveals nothing to someone who cannot prove the credential), and an inactive portal app refuses every login and grant.
Consequences
Section titled “Consequences”Good:
- One choke point instead of dozens of handler checks; new routes are covered by default.
- Closes the zero-role anchor loophole.
- The error code gives the console something precise to render.
Bad:
- The allowlist of profile routes must be maintained; a new self-service route that is not on it will be blocked for roleless users.
- Users who lose all roles lose all access, with no partial state.
- Service accounts are exempt, so their safety depends on the applications claim and permission checks.
Alternatives considered
Section titled “Alternatives considered”| Alternative | Why not |
|---|---|
| Fix each leaking handler | Misses future handlers, and anchor short-circuits remain. |
| Deny sign-in for zero-role users | They still need to reach their profile (password, 2FA, passkeys). |
| Treat zero roles as a default read-only role | Invents implicit permissions. |