Chapter 6 · Part II — Authority, review, and evidence

Give each operation the authority it needs

The application has two everyday roles: technicians create candidates, and inspectors review them. Alice holds both roles in the laboratory. That is deliberate. If the test gave the submitter no inspector role, her failed approval could demonstrate only a role restriction. Giving her both roles makes the independent-review guard necessary.

Permissions answer who may attempt an operation. Field rules narrow the values a permitted operation may read or write. Transition grants identify named actions. Aegis policies add further conditions in Chapter 8. Keeping these layers distinct makes a denial easier to explain.

Grant the operation explicitly

The application declares list, get, create, update, and delete permissions. It does not rely on an administrator being universally special. The test administrator manages the environment; technician and inspector identities exercise the business operations.

Calibration updates use this expression fragment:

update: "hasRole('technician') && $record.status == 'draft'"
delete: []

The caller must be a technician and the stored record must be draft. The empty delete role list refuses that operation. This rule does not yet authorize an inspector to approve a submitted record; that needs a named transition grant.

transitions:
  submit: [technician]
  approve: [inspector]
  reject: [inspector]

An unlisted transition inherits the resource’s update permission. An explicit transition grant takes precedence. Without these entries, a well-intentioned rule that locks updates after submission can also prevent the inspector from performing approval. State-machine guards and permissions.transitions are related checks, but they are not interchangeable declarations.

Protect the provenance fields

The server stamps submittedBy on submission and approvedBy on approval. Ordinary callers must not supply those values through create, PATCH, PUT, or a transition body. The example gives those fields a write restriction requiring the admin role, while the ordinary create and transition roles do not include admin.

This is a composition of restrictions, not a claim that the string admin is intrinsically trustworthy. Role assignment remains an operational boundary. A deployment that grants a user both the administrative field role and the business-operation role has changed the assumptions of the example.

The state field receives the same write restriction. The state machine moves it through its own controlled assignments. A client form’s inability to edit status is not part of this protection; a direct HTTP request must encounter the same server-side rules.

An empty field list has a different meaning

The current field-permission parser treats absent or empty read and write lists as no additional field restriction. Therefore permissions.fields.secret.write: [] is not a reliable way to prohibit writes to that field. This differs from the operation-level delete: [] above.

A notation can look uniform while its consumers implement different defaults. This is exactly the sort of detail a revised handbook should teach through a small example and a direct source reference. ADL 21 §21.3 documents the current behavior.

Check returned data as well as incoming writes

Field read rules must cover responses from writes too. An application can protect GET and still leak a secret in the response to create or transition if those paths forget the final filter. One of the engine fixes described in the Aegis work addressed this class of inconsistency.

The calibration example has no confidential field, so its lab does not demonstrate every response-filtering path. If you add an internal comment, test its absence in list, get, create, update, transition, relationship expansion, and export as applicable. Each path is a separate observation until shared implementation and tests justify a broader claim.

Follow a refusal to its deciding layer

A denied request may fail authentication, operation permission, field permission, policy, state validity, guard evaluation, or validation. Retain the error code as well as the HTTP status. Two requests returning 403 can have very different explanations.

The lab tests a forged provenance value and a self-approval with otherwise valid authority. It then uses a different trained inspector to establish the successful neighboring path. This gives the permission story both a positive and a negative control.

Workshop

Draw a table with four columns: operation, required role, writable client fields, and server-stamped fields. Fill it for create, submit, approve, and reject. Look for a field that can be rewritten through a different operation than the one that first created it.