M5-S2 — The permission engine
Section titled “M5-S2 — The permission engine”| Module | M5 — Identity, access and security |
| After this session you can | Decide, as the engine does, whether a request is allowed and which fields it may see, and prove the decision on the running platform. |
| Time | 60 min with a facilitator · about 60 min on your own |
| Before you start | M5-S1 (identity) and M3-S2 (the list-read pipeline). Larkspur Lab, Rami Aziz signed in; private windows for Tariq Saleh, Huda Rahman and Omar Haddad; the workbench API window. |
| Go deeper | Engine: Permissions and voters · Permissions API · The security boundary |
◆ Orientation (1 min) — From identity to yes or no
Section titled “◆ Orientation (1 min) — From identity to yes or no”The gateway has told the data service who is calling. Now the data service must say whether. In ACSA M2-S1 you learned the ladder as an administrator applies it, and in ACE M7-S2 you designed a suite’s grants with it. This session opens the engine that turns those grants into a decision on every request, reconciles what its code says about “deny” with what the product does, and adds the parts an administrator rarely sees: protected fields, delegation, caching and the cap on who may grant what. In the lab you decide eight Larkspur cases the way the engine does and prove three of them live.
▤ Concept (9 min) — Grants, resolution, votes
Section titled “▤ Concept (9 min) — Grants, resolution, votes”The levels are numbers
Section titled “The levels are numbers”| Level | Value | What it opens |
|---|---|---|
| None | −1 | Nothing; setting it on a grant removes that grant |
| Restricted | −0.5 | System level only: a floor that opens nothing by itself, but lets resource grants take effect |
| View | 0 | Read |
| Developer | 0.5 | Read and build: change the design |
| Edit | 1 | Read, build and write; every check that asks for Edit also accepts Developer’s build rights |
| Admin | 2 | Everything; offered only at system level |
The values are fractions on purpose. The engine compares levels with “greater than or equal” and keeps the highest, so Developer and Restricted slot between the whole numbers without breaking the order.
Resolution: many grants, one level per resource
Section titled “Resolution: many grants, one level per resource”flowchart TD U["A user"] --> M["Memberships: groups, roles,<br/>org units, query groups"] U --> G["Grants held by the user<br/>and by each membership"] M --> G G --> F["Drop archived grants<br/>and grants outside their dates"] F --> X["Per resource: keep the highest level<br/>that resource type offers"] X --> B["Sort into system, module, entity,<br/>view, page, report"] B --> E["Module grants reach the module's entities;<br/>views open to all signed-in users are added"] E --> C["Cached per user"]
What to notice: there is no step that subtracts. Every source can only add a grant, and the merge keeps the highest one.
The engine builds each user’s effective permissions in one database aggregation: it collects the user’s memberships (groups, roles, organization units and groups defined by a query), collects every grant held by the user or by any of those, drops grants that are archived or outside their expiry window (a malformed window counts as outside, so it fails closed), and then keeps, per resource, the highest level that the resource type actually offers. A module or entity offers View, Developer and Edit; Admin on a module or entity is not offered and opens nothing. Since 1.6 every offered level a user holds is also kept beside the highest, so a user who holds both Edit and Developer on a module passes a check for either. The result is sorted by kind, module grants are expanded to the module’s entities, and views opened to every signed-in user are added.
The result is cached per user. Any change to any grant invalidates every user’s cache at once: correctness over efficiency. Since 1.10 the invalidation bumps a generation number instead of sweeping keys, which keeps that cheap even with many users.
No deny: two layers, two meanings
Section titled “No deny: two layers, two meanings”The engine’s documentation speaks of “deny” in two places, and the product behaves as if there were no deny at all. Both are true, because they describe different layers.
The grant layer has no deny. In the running product, setting None on a grant deletes that grant; it does not store a rule that blocks other grants. Setting Restricted on a module, entity or view is turned into the same removal, which drops the person back to whatever their system level gives them. Access is therefore the highest grant from any source: if a group gives Edit, removing the person’s own View changes nothing. This was verified on the running product in November 2026.
The decision layer votes. For each request, the engine asks several voters for a decision: allow, deny or abstain. A voter’s deny is not a stored rule; it is a vote saying “the grants this identity holds do not reach the level this request needs”. The votes are combined strictly: any deny wins over any allow, and if every voter abstains the request is refused. So “the engine denied it” always means “nothing granted enough”, never “something forbade it”.
When a learner asks whether a stored “None” can block a higher group grant, the answer is no on the grant layer; the one place the engine page describes a None that blocks is a None system record, which the product does not create when you set a person’s system level to None, because that, too, removes the grant.
The decision, request by request
Section titled “The decision, request by request”flowchart TD
R["Request reaches the data service"] --> V{"Through a published view?"}
V -->|yes| VL["The view's own access settings decide<br/>(checked when the view is resolved)"]
V -->|no| N{"Any system grant?"}
N -->|no| D1["Refused"]
N -->|yes| A{"System Admin?"}
A -->|yes| OK1["Allowed"]
A -->|no| SV{"System View or above,<br/>and a read?"}
SV -->|yes| OK2["Allowed"]
SV -->|no| VO["Resource voters: entity, module, related record"]
VO -->|"read: can view? write: can edit?"| RES["Combine votes: deny wins, all-abstain refuses"]
What to notice: a system viewer may read everything, which is why system View is a large grant; a write always reaches the voters.
A request through a published view is decided by that view’s own access settings, which is the
narrow door you used in ACE. Anything else goes through the engine’s checks in a fixed order: no
system grant at all refuses; system Admin allows; system View or higher allows a read; a
system-Restricted user with at least one module or entity grant may use the reads that opt in to
it. Everything else reaches the resource voters, which map the HTTP method to a need: a GET
needs can view, a POST, PUT, PATCH or DELETE needs can edit. Can view an entity is true
with View on the entity, any edit-level reach, View through its module, or system View. Can edit an
entity is true with Edit or Developer on the entity or its module, or system Developer. Platform
entities that everyone needs to read, such as users, groups and organization units, can be read by
any user with a system View, or a Restricted user with a resource grant, and changed only by system
administrators.
Sensitive fields: a second lane
Section titled “Sensitive fields: a second lane”A sensitive-field grant carries no level; it carries a scope such as
supplier_management/suppliers/bank_account, where any segment may be *. The engine collects these
scopes in a separate lane of the same aggregation, so they never take part in the highest-level merge
and can never raise anyone’s access. Wildcards are kept as written and matched at check time, segment
by segment.
To see a sensitive value on an entry read, a user needs both a matching scope and, since 1.8, an active Unmask session, which ACSA taught as the administrator’s view. Without the session, the value is masked even for a holder. The other guards use the grant alone: a write that would store a mask over a real value fails, a query that filters on a sensitive field is refused for a user without the grant (the guard you met in the list-read pipeline), and history masks the value. Automations follow the reaction’s Sensitive Data Access Policy (M4-S2’s executor decides whose grants count).
Delegation, and the cap on granting
Section titled “Delegation, and the cap on granting”A delegation lets one person act for another. When the delegate acts, the engine builds their permissions from the delegator’s, narrowed by the delegation’s scope (allow all, or deny all, with exceptions). Since 1.10 an allow-all delegation carries no administrative rights unless the delegation allows administration: a delegator’s system Admin is replaced by the highest lower system level they also hold. Everything a delegate does is recorded with both identities.
A grant is capped at the giver’s own level (since 1.8). Below system Admin, nobody may grant a
level above their own effective level on that resource, or change or remove a grant already above
it: the refusal is 403 PERMISSION_GRANT_EXCEEDS_CALLER_ACCESS. Reactions that grant or remove access
are held to the same rule when they are saved: the saver’s level is the ceiling.
▶ Guided demo (10 min) — Where a level comes from
Section titled “▶ Guided demo (10 min) — Where a level comes from”Starting state. Larkspur Lab as seeded. Tariq Saleh has system Restricted, View on the module Quality and Compliance through the group Quality, and his own Edit on the entity Non-conformances.
- Open Administration › Access Management › User Permissions and select Tariq Saleh. Two lines for Quality and Compliance resources: the module through Quality, the entity Direct.
- Read Assignment Type and Acquired Through on each line. The entity’s Edit is direct; the module’s View comes from the group.
- As Tariq, open a non-conformance and change its Root cause. It saves: Edit on the entity reaches.
- As Tariq, open a Corrective Action. It opens read-only: only the module’s View reaches that entity.
- In the API window, read the same answer the screen reads:
curl -s "$BASE/api/v1/permissions/user/<Tariq id>" -H "x-app-token: $TOKEN" | jq '.result[] | {name: .object.name, type: .object.type, assignmentType, through: .acquiredThrough.name, abilities: .object.abilities}'. - Compare with the screen of step 1: the same two lines. The
abilitiesof the entity line includeedit; those of the module line do not. These booleans are what the web app uses to show or hide actions.
Screenshot pending User Permissions for Tariq Saleh, with the module View acquired through the Quality group and the entity Edit assigned directly What to notice: Acquired Through is where you would take a grant away; removing the wrong line changes nothing.
✓ Practice (4 min) — Resolution and votes
Section titled “✓ Practice (4 min) — Resolution and votes”Huda Rahman holds View on Asset Maintenance directly and Edit on it through the group Operations Leads. An administrator sets her direct grant to None. What can she do on Asset Maintenance now?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
A user’s group gives Admin on the module Procurement. The user has no other grant on it and system Restricted. What does the Admin grant open?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
Leila Amari has system View and no other grant. She sends a PATCH to update a supplier
directly through the API. What decides the answer?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
⛏ Lab (27 min) — Eight cases, three proofs
Section titled “⛏ Lab (27 min) — Eight cases, three proofs”Goal. Decide eight Larkspur access cases as the engine does, writing the rule you used for each, then prove three of them live.
Before you start. The seeded grants listed in each case. The private windows for Tariq, Huda and Omar. A notes table: case, decision, rule.
Part A — decide on paper (cases 1 to 8)
- Sara Qasim: system View; the group Procurement has Edit on Procurement. She edits a purchase order. Decide.
- Leila Amari: system View, nothing else. She opens Spend by Supplier and then tries to archive a supplier. Decide both.
- A new contractor account, created with system Restricted and no resource grant yet, looks for the Services menu.
- Tariq Saleh: View on Quality and Compliance through Quality; his own grant on Non-conformances is set to None. He opens a non-conformance.
- Huda Rahman: system View and her own Edit on the entity Work Orders; an administrator sets Restricted on Work Orders for her. She opens a work order, then tries to edit it.
- Omar Haddad: no sensitive-field grant. Sara Qasim: the group Procurement holds the scope
supplier_management/suppliers/bank_account. Both open Brightmoor Bearings. What does each see, and what must Sara do first? - Sara delegates Allow All to Tariq for her leave, administration not allowed. Tariq, acting as her delegate, edits a purchase order.
- Omar: Developer on Asset Maintenance, system View. He tries to give Maya Edit on Asset Maintenance.
Part B — prove three live
- Case 4. As Rami, in Access Management › User Permissions for Tariq Saleh, set his direct grant on Non-conformances to None. The line disappears.
- As Tariq, open NC-0311. It opens (read-only): the group’s View on the module still reaches it.
- Case 5. As Rami, set Restricted on Work Orders for Huda Rahman. Read her User Permissions: no line for the entity any more.
- As Huda, open WO-1007. It opens read-only through her system View; the edit action is gone.
- Case 6. As Omar, open Brightmoor Bearings. Bank Account shows a mask and no way to reveal it.
- As Sara, open the same supplier. Bank Account is masked; start an Unmask session (the user menu at the top › Unmask) and confirm who you are. The value appears; reload after the session ends and it is masked again.
Screenshot pending The Bank Account field of a supplier, masked for Omar Haddad and revealed for Sara Qasim during an Unmask session What to notice: Sara’s grant alone does not reveal the value; the Unmask session does, and only for scopes she holds.
Check.
- Each of the eight cases has a decision and the rule that produced it.
- Case 4: after None, Tariq still reads through the group.
- Case 5: Restricted on the entity removed the grant, and Huda reads through her system level.
- Case 6: Omar always sees a mask; Sara sees the value only during an Unmask session.
- Your rules for cases 7 and 8 name the delegation filter and the cap on granting.
- Tariq’s and Huda’s grants are restored to the seed.
Pass condition. All eight decisions match the worked solution, and the three proofs show the outcome you predicted.
If something goes wrong
| What you see | What to do |
|---|---|
| Tariq cannot open NC-0311 after step 9 | Check the group grant is on the module Quality and Compliance and that he is still a member of Quality. |
| Huda cannot open the work order | Her system level may be Restricted, not View; read her Admin Permissions. |
| Sara sees the bank account without unmasking | An Unmask session from earlier is still active; it ends at its own time. |
| The screen still shows the old access | Reload: the effective permissions are cached, and the cache is cleared on every grant change. |
Model answer
- Allowed. The group’s Edit on the module reaches the entity; the merge keeps the highest level.
- Opens the dashboard; archiving refused. System View allows every read; an archive is a write, which needs can edit, and nothing reaches it.
- No Services menu. A system-Restricted user with no resource grant has nothing to read, and the product hides the menu for a Restricted system level.
- Opens, read-only. None removed only his direct grant; the group’s View on the module remains.
- Opens, read-only; the edit is refused. Restricted on an entity is turned into a removal of her Edit, so she falls back to system View, which allows reads and nothing more.
- Omar: always a mask, no scope matches. Sara: a mask until she starts an Unmask session; the scope through her group is necessary but not sufficient since 1.8.
- Allowed. As a delegate he acts with Sara’s grants, including her group’s Edit; only administrative rights are filtered out, and she has none.
- Refused with
403 PERMISSION_GRANT_EXCEEDS_CALLER_ACCESS. His own effective level on the module is Developer, below the Edit he tries to grant.
◇ Worked scenario (2 min) — “Everyone can see the bank accounts”
Section titled “◇ Worked scenario (2 min) — “Everyone can see the bank accounts””An internal auditor reports that a purchase-order export shows suppliers’ bank accounts in clear text to a buyer who has no sensitive-field grant. Decide at each step before you read on.
Step 1. Which path showed the value? The buyer did not open a supplier. The export came from the reaction Send PO pack to supplier, which builds a document from the purchase order and its supplier and emails it to the buyer. A reaction is not a user reading an entry, so the Unmask rule does not apply: the reaction’s Sensitive Data Access Policy does.
Step 2. Which policy? The reaction was written before the setting existed, so it has none, which means Privileged: the automation always sees real values, whoever triggered it. The buyer’s own grants never entered the decision.
Step 3. Choose the policy. Two options. User-Based would show the value only to triggerers who hold the grant, but the reaction also runs on a timer, and User-Based cannot be combined with an automatic trigger. Auto runs system-triggered runs as Privileged and user-triggered runs as User-Based. The pack does not need the bank account at all, so you choose Prohibited and remove the field from the template: the cheapest way to protect a value is not to send it.
Step 4. Find the others. You list every reaction on an entity holding a sensitive field and read their policies, and add a standard rule: every such reaction states its policy, and any Privileged choice is recorded with its reason.
The lesson: a protected field has more than one door. People go through grants and Unmask; automations go through their policy, and the default is the widest.
✓ Practice (6 min) — Fields, delegation, caching
Section titled “✓ Practice (6 min) — Fields, delegation, caching”Sara holds a sensitive-field scope on Bank Account through her group. She builds a personal list
view filtered on Bank Account starting with GB. Omar, who holds no scope, copies her filter into his
own query. What happens to Omar’s query?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
Rami Aziz, a system Admin who also holds system View through a group, delegates Allow All to Omar for a week, without allowing administration. What system level does Omar have when he acts as Rami’s delegate?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
A grant to the group Field Technicians has the expiry window ["2026-11-01","2026-11-30"]. Another
grant to the same group was imported with the expiry stored as a single date. Which grants count on
20 November?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
A builder with Edit on Quality and Compliance saves a reaction that grants Edit on Procurement to whoever raises a non-conformance. The builder has View on Procurement. What happens?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
After you add Maya to the group Quality, her screen still shows the old access for a moment. Why, and what clears it?
Check your answer
The correct answer is C. Open the explanation under each option to see why.
↺ Recap (1 min) — Yes or no, and why
Section titled “↺ Recap (1 min) — Yes or no, and why”You can now resolve a user’s effective level from every source, decide a request as the voters do, explain why the product has no deny although the engine votes deny, and say what it takes to read a protected field, act as a delegate or grant access. Next, M5-S3: the security primer, which gives you the vocabulary to say what could go wrong around all of this, before M5-S4 threat-models the suite.