Skip to main content

The model

Archenstack boils authorization down to one small, ordered grid. This page walks you through every moving part; Resolution, scopes & the authorizer explains how a cell is computed and enforced.

One matrix, or one per org

This page describes a single access matrix. A deployment that serves multiple tenants owns one such matrix per organization, fully isolated — same model, repeated per org. See Organizations (multi-tenancy) for how an org selects which matrix a caller resolves against.

The access matrix​

Think of permissions as a grid: features run down the rows, roles across the columns, and each cell holds a single access level. A caller's effective access to a feature is just the cell at (feature, their role).

administratormanagerstaff
records.viewFULLFULLVIEW
records.editFULLPARTIALPARTIAL
reports.exportFULLPARTIALNONE

That really is the whole data model: a set of roles, a set of features, and a level in each cell (plus a few rules layered on top, which we'll get to below).

Access levels​

Every cell resolves to one of four ordered levels:

LevelValueMeaning
NONE0no access
VIEW1read only
PARTIAL2write, but scoped — only some objects (e.g. your own records)
FULL3unrestricted read + write

The ordering is the whole point — it lets comparisons express intent directly:

  • level >= VIEW → can read
  • level >= PARTIAL → can write (subject to a scope, see below)
  • level >= FULL → can write anything

Those integer values (0..3) are part of the wire contract, so they never change within a wire major version.

Roles​

A role is a named principal class — one column of the matrix. Every role has a kind:

  • standard — an ordinary matrix column with its own cells.
  • super — a superuser. It always resolves FULL on every feature, and it's never a real column (it has no cells). This is your recovery escape hatch.
  • alias — mirrors another role. A query for the alias resolves exactly as its target (single-hop; an alias may not point at another alias or a superuser).
The sample catalogue

The bundled sample catalogue that every backend seeds uses: owner (super) · administrator (standard, the anti-lockout holder) · manager · staff (standard) · supervisor (alias → manager).

Features​

A feature is a row of the matrix — a named unit of functionality you restrict, like records.edit or reports.export. Feature keys are dotted, lowercase slugs. A feature carries its code defaults (the level per role that ships in your source) and, optionally, a partial scope (what a PARTIAL write is restricted to — see scopes).

Groups​

Groups are display buckets that help you organize roles and features in an editor UI (section headings like Administration or Reporting). They're presentation only — they never affect resolution.

Defaults vs. overrides​

Two layers decide a cell's value:

  • Defaults — the policy that ships in your source code (seed-owned). You can't edit these through the matrix API.
  • Overrides — edits an admin applies at runtime (stored in your database). This is the only runtime-editable layer.

The effective level is the override if one exists, else the default, else a conservative fallback (NONE). Superusers and aliases are applied on top of this — see the resolution algorithm.

Why split defaults from overrides?

Shipping sensible defaults in code means a fresh deploy is already usable and safe; overrides are just a thin delta an admin tunes. An override that merely restates the default is redundant, so it's discarded — which keeps the override layer a minimal, auditable set of intentional changes.

The management feature​

One feature — rbac.manage — controls permission administration itself. It's special: an org's matrix can never be edited into a state where no active standard role can administer it. That anti-lockout invariant — checked per organization — is covered in Resolution, scopes & the authorizer.

See also​