The 11 permission strings, and the three levels they are enforced at.
Defined in platform/contracts/src/permissions.ts. The required deployment policy grants
app permissions through app-local roles and email membership; platform administration is an explicit
operator grant. Auth0 authenticates identities and affiliations, but provider roles are not authority.
See application access.
| Permission | Grants |
|---|---|
templates:read | View templates. Also gates the Templates nav item. |
processes:read | Read own processes. |
processes:read_all | Read all processes in the app. Also confers step writes, not item-level control. |
processes:write | Act on processes — update and complete steps. |
processes:delete | Hard-delete a process. |
processes:audit | Cross-process read with no write. Gates records and the Records nav item. |
processes:reopen | Reopen a completed process. |
processes:manage_all | Item-level control of every process in the app: sharing, and abandon/reopen/delete with their own permission. |
database:read | View the document database. Gates the Database nav item. |
database:write | Create and edit collections and documents. |
user:impersonate | Act as any user in one of their orgs, tenant-wide. |
templates:write is retired: templates are code-owned and published on deploy, and there
is no template write endpoint. A deployment policy that still lists it for an operator loads
normally and the grant is ignored (RETIRED_OPERATOR_PERMISSIONS in
platform/backend/src/deployment-access-configuration.ts); remove it from the policy at your
convenience. Unknown permissions are still rejected.
Item-level control (changing sharing, abandoning, reopening, deleting) needs the owner, an editor the process is
explicitly shared with, or processes:manage_all. processes:read_all does not qualify, nor does a contributor link
(defaultVisibility: "contributor"); both still allow step writes where the step's own permissions allow. Abandon,
reopen and delete also need their global permission (processes:write, processes:reopen, processes:delete). Anything
else is refused (403 forbidden). Grant manage_all to administrators and the EPL only.
processes:audit exists specifically because processes:read_all confers step writes. An
auditor needs to read every run without being able to change one — grant audit, not
read_all.
Permissions are checked at three widths, narrowing as you go in.
The canonical service enforces process start permission. Legacy source template.permissions[] is
retained as presentation metadata, not newly introduced as an enforcement gate.
step.permissions[] on an input step gates who may edit and complete it.
The canonical application service performs the check.
Separately, completeExpression gates whether the step can be finished at all — a
different question from who may edit it. It has hasPermission("name") in scope.
input.permissions[] on an individual field. Users without a match see the field
read-only. Writes are filtered to permitted keys before the merge, so a rejected
field write is dropped silently rather than rejected loudly.
This is what lets two actors own different fields on the same step.
Matching is OR at every level: holding any one of the listed permissions is enough. An empty or omitted array means no restriction beyond the level above.
input.readPermissions[] on a top-level field restricts who may read its stored value. A
viewer holding none of them gets every process read without it: the canonical service's read
projection (project in platform/runtime/src/application-service.ts) removes the value from
context, removes it from the field audit (an entry that changed only withheld fields is dropped)
and drops the field from the step's form. Every read is built by that projection — one process,
lists and their context filters, context counts, exports, records and file downloads (which check
the projected context) — so nothing a withheld viewer can call returns it.
It is projection policy, held in the presentation, so adding or changing it is not an execution
change and needs no template version. The rules of the pinned and the latest presentation both
apply, so a rule added later also withholds values recorded before it. The rules of the presentations a
process was on before (its migrations' from/to presentations) apply too, to fields neither the pinned nor
the latest presentation declares: a version that removes an internal field keeps its values in the field
audit, and their rule does not lapse with the declaration (spell-vote-batch v5's removed request note and
linked list). A field still declared follows its current declarations, so relaxing a rule stays possible.
Two consequences, both enforced: a single read (and its audit evidence) fails (500 presentation) rather than
serve a process whose earlier presentation cannot be found (its rules are unknown), while a list (and the audit
records) never fails for one such row: it raises an alarm and serves that row with every field no current
presentation declares withheld from everyone; and a migration that would declare such a
removed internal field again without a read rule, or rename an internal field to one without a rule, is
refused (422 internal-rule-lost). The release step checks the first one ahead of time: it publishes nothing
while any presentation named in a migration audit is missing from the registration store, and its dry run
reports it (template versions). Only presentations a process was on count: a process never held values
of a version it skipped (a migration's defaults for it are kept in the migration audit, which no read
serves). Give write access only to
holders of a read permission. Example: spell-request's EPL commentary for the strategic team
(s08_prepare_strategic_review.eplComment, #137) is readable with processes:read_all,
processes:audit, spell:manage or spell:manage-tech, which a Prime's role holds none of.
input.historyReadPermissions[] (#206) restricts who may read a top-level field's history while its
current value stays readable: a viewer holding none of them gets no field-audit entry for the field (its
other changes in the same entry stay), so a value that was replaced leaves no trace for them. A field whose
value is withheld (readPermissions) loses its history as well. Same projection, same presentation-only
rule (no template version), same validation (top level only, a list of strings). Example: the executive vote
batch's public view (spell-vote-batch v00_vote.publicView): every Prime's team reads the current list of
in-vote items, and only the internal seats read the earlier lists, which can name items since taken out.
A build that predates this property refuses a registration that uses it (as for #104's choices).
A template's notes[] (presentation notes, #153) declares running notes that belong to the process
rather than to a step: { key, title, description?, placeholder?, permissions, readPermissions? }.
Holders of permissions write one with PUT /api/process/{id}/notes/{key} ({ text, expectedUpdatedAt? })
at any time — whatever step the process is at, finished processes included — given editor access to the
process. The text is stored on the process record beside, never in, the program's memory, so context,
context filters and counts, migrations and the program never see it. A read sends notes[] with each
readable note's text and who last edited it and when; readPermissions withholds the note (and its
field-audit entries, under stepKey @notes) from everyone else, on every read the projection builds.
Writers must also be readers. Like readPermissions, notes live in the presentation: adding one is not a
template version. A write while impersonating is made and authorized as the real user (#89).
Example: spell-request's EPL notes (eplNote) are written and read with spell:manage only: in production
the EPL (spell-pm) and soter-admin roles; not Prime, Sky Core, BA Labs or the tech coordinator, who hold
processes:read_all or spell:manage-tech.
A template's followUps[] (presentation followUps) declares an optional list of "these people, this
action" entries that belongs to the process, not to a step: { key, title, description?, permissions, readPermissions? }. Holders of permissions add, edit and remove entries with
PUT /api/process/{id}/follow-ups/{key} ({ action: "add", text, assignees }, { action: "update", entryId, text, assignees, expectedUpdatedAt? }, { action: "remove", entryId, expectedUpdatedAt? }) at any
time, finished processes included, given editor access. An entry saves only with at least one person and
some text; the list may stay empty, and nothing in the process ever waits on it. assignees are emails from
GET …/follow-ups/{key}/assignees: the members of the process's application whose deployment-directory
affiliation is one of the deployment's follow-up assignee groups (PROCESS_FOLLOW_UPS_CONFIG), so a
template cannot widen who may be named. Entries live on the process record beside the notes, never in the
program's memory; a read sends followUps[] with each entry's people, text, author and, per person, its
tracker task (queued, linked with the task's link and last known status, failed, cancelled);
readPermissions withholds the list and its field-audit entries (stepKey @followUps) from everyone
else, on every read. Writers must also be readers. Each (entry, person) is one task in the deployment's
tracker, created, updated and cancelled by the platform's sync runs (see
follow-ups); the same person on two entries has two tasks.
Example: spell-request's followUps is written with spell:manage or spell:manage-tech (the EPL, the tech
coordinator, and admins through soter-admin's spell:manage) and read by the readers of the EPL's commentary
(processes:read_all, processes:audit, spell:manage, spell:manage-tech): Soter, Sky Core and BA Labs
read it; a Prime gets no trace of it from any read.
{
key: "allocation-review",
permissions: ["processes:write"], // 1. who may start a run
steps: [{
key: "review",
type: "input",
permissions: ["risk:review"], // 2. who may act on this step
inputs: [
{ key: "summary", type: "string", title: "Summary" },
{ key: "approved", type: "bool", title: "Approved",
permissions: ["risk:signoff"] }, // 3. who may edit this one field
],
completeExpression: 'hasPermission("risk:signoff")',
}],
}
A holder of risk:review opens the step, edits summary, sees approved read-only,
and cannot finish. A holder of risk:signoff can do all three.
When adding a route, see add an API route for which helper to reach for.
| Helper | Use |
|---|---|
lib/require-permission.ts | Assert a permission on an API route. |
lib/require-process-read.ts | Read access to one process, honoring read_all and sharing. |
lib/require-process-write.ts | Write access to one process. |
lib/input-permissions.ts | Filter a field-write payload to permitted keys. |
template.roles[] maps a friendly actor name to one permission string:
{ id: "govops", name: "GovOps", permission: "processes:write", color: "#3b82f6" }
Editor metadata only. Roles compile down to the same permissions[] arrays the
engine already reads — the engine has no concept of a role. People are never stored
in presentation metadata. App access declarations own membership and role assignments.
An actor holding user:impersonate may send X-Impersonate-User-Id plus optional
X-Impersonate-Organization-Id (defaults to the actor's own org).
getPrincipalFromRequest then resolves the effective principal as that user in the
target affiliation, with that user's verified identity resolved through Auth0 and authority derived
from the deployment policy. Each subsequent process operation rebinds to the target app.
Two things stay put:
X-Process-Platform-Organization header remain on the actor's own org.principal.impersonatedBy, surfaced as actor on /api/me.Only the effective principal switches. The UI searches /api/impersonation/targets and
stores the chosen user and org in localStorage for every subsequent authFetch. The search lists
each email once: when several Auth0 accounts share an email (for example a used login plus a
never-used invite placeholder) it keeps the most recently signed-in one, since impersonation binds to
the verified email and the accounts are equivalent targets.
Frontend profiles are not an access boundary. Hiding a route from a skin's sidebar does not prevent anyone from typing the URL. The deployment policy, app membership and canonical process/activity checks enforce access regardless of which frontend sent a request.
See whitelabel.
Use /api/me?processId=… or ?templateKey=… for target-app permission checks, never a union of
applicationPermissions. Unscoped permissions contains platform grants only. The backend rechecks
commands independently of these UI hints. Document exports require an explicitly app-owned asset.
File deletion requires recorded activity ownership and current field editability; upload permission
alone is not permission to delete any attachment.