Repository navigation
Commit 48fba2b
docs(permissions): recipe for locking a position's fields once a record reaches a stage (field permission when) (#26251)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9SG7rbUyLNjoTR3C1zMwjh7)_
Fixes #26178
Clause-②: no
Metadata-protocol: none
## What
An administrator-facing recipe for the field permission `when` ("at this
stage, these people may no longer change these fields"), which until now
only the developer reference described.
- `content/docs/permissions/access-recipes.mdx`: a new row in the layer
table, and a recipe **Lock fields for a position once a record reaches a
stage** on the card's contract case (finance edits drafts, but
`governing_law` / `liability_cap` freeze once `status in ["approved",
"signing", "active"]`). It carries the editor path (Setup, Access
Control, Permission Sets, open the set, expand the object, field row,
**When (edit)**, Add condition), the same entries as
`definePermissionSet` metadata, how to choose (a lock for everyone is a
validation rule; a lock that depends on who edits is a field permission
`when`), and the four boundaries from the card: edit only, same-object
fields only, the stored record before the write on update, and it locks
but does not grant under the most-permissive merge.
- `content/docs/permissions/administrator-guide.mdx` Step 5: the
field-level security bullet now names the **When (edit)** condition and
points to the recipe.
- `content/docs/permissions/field-level-security.mdx`: the `when`
section links to the recipe.
The recipe's metadata block is a self-contained `{/* os:check */}`
example, so `check:skill-examples` type-checks it against
`@objectstack/spec` from now on.
## Evidence
- The block parses against `PermissionSetSchema` from
`packages/spec/src` (one-off `tsx` run, not committed): recipe snippet
`success: true`; negative control `readable: false` beside the same
`when` is refused at `fields.clm_contract.governing_law.when` with the
schema's own message ("A `when` reaches the EDIT vote only ...").
- Reverse check of the pin, on committed head 70e79e2: renaming `when`
to `whenn` in the block turns `check:skill-examples` red (exit 1, TS2561
at `access-recipes.mdx:67:70`, "Did you mean to write 'when'?");
restored with `git checkout HEAD --`, blob `2c041d93` matches HEAD, `git
diff HEAD` empty.
- Studio labels checked against
`ui/packages/app-shell/src/views/metadata-admin/i18n.ts`
(`perm.field.when` = "When (edit)", `perm.field.when.add` = "Add
condition") and `PermissionMatrixEditor.tsx` (the condition cell shows
only while Read is on).
## Gates (head 70e79e2)
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 44 commands derived; all 44 run, each exit
captured before any pipe, all exit 0. `--ran` reconciliation: 44
derived, 44 run, 0 NOT-MEASURED (derived from recorded exit codes).
Includes `pnpm check:doc-authoring`, `pnpm check:doc-anchors` (606
fragment links resolve), `pnpm check:role-word`, `pnpm --filter
@objectstack/spec run check:skill-examples` (263 marked examples, up
from 262).
- The lychee link check (`Check Documentation Links`, advisory) has no
local binary here: NOT MEASURED locally, read from this PR's check run.
Every new link targets an existing page
(`/docs/data-modeling/validation`, `/docs/permissions/authorization`,
`/docs/permissions/field-level-security`,
`/docs/permissions/access-recipes`), and the anchors are covered by
`check:doc-anchors` above.
## Acceptance notes
- `check:role-word` refused the first draft's word "role" in prose
(ADR-0090 D3), so the recipe is titled for a **position**, the
administrator's unit of assignment. The card's own wording used the
reserved word; nothing else changed in meaning.
- Docs only: nothing published moves, so `skip-changeset`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01GEk1n2M6ejRZucZuYZLamJ)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 26e1453 commit 48fba2b
3 files changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
43 | 89 | | |
44 | 90 | | |
45 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
0 commit comments