From edbee340d45883b5d04794ac43e6a9694655fa1e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 15:32:36 +0000 Subject: [PATCH] docs(adr): ADR-0066's viewAllFields vote anchor names holdsViewAllFields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 2026-11-24 note under D2 ⑧ anchored the function the `viewAllFields` read vote is cast in by its name, `superuserFieldVote`. The field-axis split's last step (draft PR 37371) replaces that function, so the anchor stops resolving on that branch and `check:adr-symbol-anchors` reds there. The sentence now anchors `holdsViewAllFields`, the predicate that reads the bit, and describes the vote function by its relation to it: the one function that calls the predicate, which both field merges call. That holds on `main` today (the caller is `superuserFieldVote`) and on the split's branch (the caller is `viewAllFieldsReadVote`), so the anchor resolves on both trees and the sentence stays true across that merge. One sentence of one dated note; no decision text and no other note is touched. The end-state note for D2 ⑧ is a later row of the weekly ADR revisions card and is not written here. Claude-Session: https://claude.ai/code/session_011y7As8wf3DSPRevwNnYLcM Co-Authored-By: Claude --- docs/adr/0066-unified-authorization-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adr/0066-unified-authorization-model.md b/docs/adr/0066-unified-authorization-model.md index a3a6e1da851..63981702311 100644 --- a/docs/adr/0066-unified-authorization-model.md +++ b/docs/adr/0066-unified-authorization-model.md @@ -143,7 +143,7 @@ Captured for the record; **out of scope for Phases 1–4 above**. Each is anchor > **Note (2026-11-15) — a set's own `readable: false` row wins over that set's own View All vote (#33828, maintainer ruling on the card, letter A).** The ruling, as the card states it: "A, platform. An explicit `readable: false` field-permission row on a permission set must win over that same set's View All (`viewAllRecords`) field vote. This amends ADR-0066 D2 ⑧ as amended by ruling of record 6573563853." In the field-permission merge, a set that holds View All on an object (its own entry for the object if it has one, otherwise its `'*'` wildcard) and does not hold Modify All on it casts **no read vote on a field its own `fields` row declares `readable: false`**. That row is the set's whole say on the field, so a set can grant View All on an object and still hide a field of it from its holders. "Explicit" is literal: an omitted `readable` parses to `true` and is never a mask. The rest of the 2026-11-02 note stands. **Another** set's View All or Modify All on the object still makes the field readable (and, under Modify All, editable) for a caller who holds both sets, which is the platform-admin case ruling 6573563853 fixed. The same set's View All still votes on every field it does not mask itself. View All never granted an edit, so an edit lock beside it binds as before. **Modify All is unchanged, kept until the field-axis split (#34365), by the maintainer's ruling on the card of 2026-11-16 (6909362597, letter A), verbatim 「保持现状,只给警告」 (keep the current behaviour, warn only):** a set that holds `modifyAllRecords` on the object still votes `readable: true` and `editable: true` on every field of it, its own rows included, so its own `readable: false` or edit lock binds none of its holders. This note replaces, **for View All only**, the 2026-11-02 note's sentence "a set can no longer withhold a field from its own View All / Modify All holders"; for Modify All that sentence still holds, and a field is withheld from a Modify All set's holders by granting the object without that bit. One function answers the per-field vote, `superuserFieldVote` (`packages/core/src/security/effective-object-permissions.ts`), asked with the field's name by both field merges, `getFieldPermissions` and the row-blind `/auth/me/permissions` merge (`buildEffectiveFieldPermissions`), so every reader of the merge answers the same. The lint rule `security-superuser-field-mask-inert` reports only a row its own set's Modify All unbinds; a `readable: false` beside the set's own View All is no longer reported. Taking a field away from a caller whom another set serves it to remains the job of the muting/deny layer ⑦ still owes. - > **Note (2026-11-24) — a set may carry `viewAllFields`, a read-only vote on every field of an object ([#36050](https://github.com/objectstack-ai/objectstack/issues/36050), step 2 of the field-axis split [#34365](https://github.com/objectstack-ai/objectstack/issues/34365), ruling of record 6912661484; built by [#36085](https://github.com/objectstack-ai/objectstack/pull/36085)).** `ObjectPermissionSchema` accepts an optional `viewAllFields` beside `viewAllRecords` and `modifyAllRecords`. A set that carries it on an object (its own entry for the object if it has one, otherwise its `'*'` wildcard) casts a read vote, never an edit vote, on every field of that object. The 2026-11-15 rule holds for it: the set's own `readable: false` row on a field beats the set's own bit. The vote is cast inside `superuserFieldVote` (`packages/core/src/security/effective-object-permissions.ts#superuserFieldVote`), so both field merges answer the same. The bit grants nothing else: no access to the object, no record (it is not part of `holdsSuperuserBypass`), no admin posture. `admin_full_access` and `organization_admin` carry it on `'*'`. That changes no answer today, because their View All and Modify All already cast the same vote. The `organization_admin` variant granted without the record bypass does not carry it. On `'*'` the bit also votes on the fields of `private`-posture objects while opening none of them; narrowing that reach would be a maintainer ruling. The notes of 2026-11-02 and 2026-11-15 stand: View All and Modify All still vote on fields. The end state of the split, where they stop voting on fields, is [#36055](https://github.com/objectstack-ai/objectstack/issues/36055) and is not built. + > **Note (2026-11-24) — a set may carry `viewAllFields`, a read-only vote on every field of an object ([#36050](https://github.com/objectstack-ai/objectstack/issues/36050), step 2 of the field-axis split [#34365](https://github.com/objectstack-ai/objectstack/issues/34365), ruling of record 6912661484; built by [#36085](https://github.com/objectstack-ai/objectstack/pull/36085)).** `ObjectPermissionSchema` accepts an optional `viewAllFields` beside `viewAllRecords` and `modifyAllRecords`. A set that carries it on an object (its own entry for the object if it has one, otherwise its `'*'` wildcard) casts a read vote, never an edit vote, on every field of that object. The 2026-11-15 rule holds for it: the set's own `readable: false` row on a field beats the set's own bit. The vote is cast inside the one function that calls `holdsViewAllFields` (`packages/core/src/security/effective-object-permissions.ts#holdsViewAllFields`), and both field merges call that function, so both field merges answer the same. The bit grants nothing else: no access to the object, no record (it is not part of `holdsSuperuserBypass`), no admin posture. `admin_full_access` and `organization_admin` carry it on `'*'`. That changes no answer today, because their View All and Modify All already cast the same vote. The `organization_admin` variant granted without the record bypass does not carry it. On `'*'` the bit also votes on the fields of `private`-posture objects while opening none of them; narrowing that reach would be a maintainer ruling. The notes of 2026-11-02 and 2026-11-15 stand: View All and Modify All still vote on fields. The end state of the split, where they stop voting on fields, is [#36055](https://github.com/objectstack-ai/objectstack/issues/36055) and is not built. - **⑨ Authoring-time validation for capability references** *(recorded 2026-07 pre-launch architecture assessment)*. `systemPermissions` / `requiredPermissions` are free strings today; a typo (`mange_users`) fails closed at runtime — the safe direction — but is undiscoverable: nothing reports that the referenced capability exists nowhere. When D1 lands the `sys_permission` registry, add the authoring/publish-gate lint alongside it: referencing an unregistered capability warns at author time (consistent with ADR-0049 honesty and the contract-first Prime Directive — reject at the producer, don't tolerate at the consumer). **Landed (2026-07):** `validateCapabilityReferences` in `@objectstack/lint` warns (never errors — cross-package capabilities and the fail-closed runtime make a hard gate wrong) when a `requiredPermissions` reference resolves against neither the built-in set (`@objectstack/spec` `PLATFORM_CAPABILITY_NAMES`), nor a capability the stack grants via a permission set's `systemPermissions`, nor a `sys_capability` seed row. Wired into `os validate` and `os lint`. `systemPermissions` (the declaration side) is deliberately not flagged. > **Note (2026-10-14) — ⑨'s seed-row source is gone.** With `sys_capability` retired by #15204