Permissions and data states
What a screen shows when the viewer may not act, and while its data loads, fails, is empty or grows old. One decision each, so every list, card and button answers the same way.
When the viewer may not
Ask in order: may they ever have it here, could they be given it, may they read it, may they open the page, does it exist for them at all.
| Show | When | How | Use |
|---|---|---|---|
| Hidden | The viewer can never have this here: another axis's tool (a platform admin's action on a project page), or a feature the plan lacks. | Nothing in its place. Never a gap or a placeholder that hints at it. | permission-gate hidden |
| Disabled, with a reason | Someone in their position could be given it: a Member looking at Remove device, which an Admin has. | In view, focusable, refused on click; the reason (the permission and who grants it) in a tooltip, on a tap and to screen readers. | permission-gate disabled |
| Read-only | They may read the values but not change them: project settings for a Viewer. | Values as text with one line saying it is view only; never fields that look editable. | permission-gate read-only |
| Forbidden region | A part of a page they may open, which needs a further permission to read: the audit log. | The region says what is missing and who grants it; the rest of the page works. | permission-gate forbidden, data-state forbidden |
| No access page | The whole page needs a permission they lack, inside their own tenant. | 403: what they cannot open and who can change it, with a way back. | status-pages NoAccessPage |
| Not found (404) | The record is in another tenant, or does not exist. Both answer the same. | Never forbidden: a 403 would confirm the record exists to someone outside it. | status-pages NotFoundPage |
Permission rules
- Decide by permission strings (
devices:delete), never by a role's name. Roles are bundles that change from product to product; the strings are the contract between the server and the interface. - Two axes, one check: the platform's permissions and the project's come with the session, and
canlooks in both. The interface never works out what a role allows. - Every disabled action says why and who can change it. A greyed button with no reason sends people to support.
- Hiding is not security. The server checks every request again; the interface only spares people an action that would fail.
- Across tenants, 404 everywhere: the page, the API and the error copy say not found, so a guessed ID learns nothing.
Data states
Every region that fetches is in exactly one of six states. A page never invents its own order of checks: dataStateOf picks the state from what the fetch knows.
| State | When | Show |
|---|---|---|
loading | Nothing to show yet: the first fetch. | One line says what is coming; bones take the content's shape. The heading and anything known already stay. |
empty | The server's total is 0. | What is missing, why, and the one action that adds it. A search with no match offers to clear it. |
error | The fetch failed and there is nothing to show. | Copy from the error's code, the code itself for support, Try again. The message is never shown or parsed. |
forbidden | The viewer lacks the read permission for this region. | Which permission, who grants it. No retry: trying again changes nothing. |
stale | The data in hand is older than it should be: a refresh failed, or an update has not arrived. | Keep the content; a notice above says how old it is, with Try again. |
ready | Fresh data. | The content alone. Calm states stay grey. |
Data rules
- Counts come from the server's
total, never fromitems.length: a page holds one page of rows, and a server may cap them. A tab's count, a heading's count and a metric all readtotalor a summary endpoint. - Lists the server pages share one query,
page,limit,sortBy,orderandsearch, kept in the URL, so a filtered view is a link. A new search or sort goes back to page 1. - Errors are read by their machine code (the envelope's
error.code), never by their message. Each code a product knows has its own sentence; any other falls back to one general sentence with the code beside it. - An error with data in hand is stale, not an error: never replace what someone is reading with a failure panel.
- Forbidden wins over every other state: a region the viewer may not read does not first load, then fail.
- Colour only for a problem. Ready and loading are grey; stale takes the warning tint, an error its icon. The status rules of the Colour foundation apply.
Sensitive actions
When the server asks for a fresh check (ELEVATED_SESSION_REQUIRED), the action waits, the person proves it is them, and the action runs. They never press it twice.
Components
| Item | For |
|---|---|
| permission-gate | Hidden, disabled with a reason, read-only or forbidden, by permission string. |
| data-state | Loading, empty, error by code, forbidden, stale and ready, with dataStateOf. |
| list-query | The list query grammar and ListPage<T>: parse and serialise URLSearchParams. |
| use-list-query | That query kept in the URL, with search debounce and page reset. |
| step-up-dialog | The check itself: a code or the password through your verify(). |
| use-step-up | Holds the action on a step-up code and replays it after the check. |
Blocks that take them
These blocks export a …Content that renders only from props: a page and its total, the query out through onQueryChange, a data state, can, callbacks that return promises, and labels.
| Block | Content |
|---|---|
| fleet-table | FleetTableContent |
| users-roles | UsersRolesContent |
| users-invitations | UsersInvitationsContent |
| users-audit-log | UsersAuditLogContent |
| settings-api-keys | SettingsApiKeysContent |
| settings-webhooks | SettingsWebhooksContent |
| settings-sessions | SettingsSessionsContent |
| notification-center | NotificationCenterContent |
| settings-page | SettingsPageContent |
| device-enrolment | DeviceEnrolmentContent |
| device-detail | DeviceDetailContent |
| offline-licence | OfflineLicenceContent |
| project-members | ProjectMembersContent |
| permission-matrix | PermissionMatrixContent |
| webhook-deliveries | WebhookDeliveriesContent |
| tenant-admin | TenantAdminContent |
| platform-health | PlatformHealthContent |
| console-overview | ConsoleOverviewContent |
| incident-queue | IncidentQueueContent |
| incident-detail | IncidentDetailContent |
| maintenance-due | MaintenanceDueContent |
| maintenance-work-order | MaintenanceWorkOrderContent |
| rollout-overview | RolloutOverviewContent |
| rollout-plan | RolloutPlanContent |
| event-log | EventLogContent |
| map-workspace | MapWorkspaceContent |
| list-detail | ListDetailContent |
| mission-schedule | MissionScheduleContent |
| sign-in | SignInContent |
| auth-passkey | AuthPasskeyContent |
| auth-invite | AuthInviteContent |
| auth-2fa | AuthTwoFactorContent |
| settings-notifications | SettingsNotificationsContent |
| settings-billing | SettingsBillingContent |
| agent-runs | AgentRunsContent |
| agent-trace | AgentTraceContent |
| agent-approval | AgentApprovalContent |
| agent-chat | AgentChatContent |
| agent-run-gate | AgentRunGateContent |
| agent-run-outcome | AgentRunOutcomeContent |
| agent-tool-permissions | AgentToolPermissionsContent |
| app-shell-mobile-tabs | AppShellMobileTabs |
| app-shell-control | AppShellControl |
| status-pages | NotFoundPage, |