You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 58a07ee
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .changeset/25610-notify-email-field-recipient.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ A `notify` node's `recipients` takes a fourth form, as the whole value: `{ email
22
22
- The form is the whole `recipients` value, never a list entry.
23
23
-`@objectstack/lint` refuses, at `os validate`, `os lint`, `os build` and the runtime publish door for a flow, an email-field recipient whose field the trigger object does not declare (`notify-email-field-unknown`), one whose field is not `email`-typed (`notify-email-field-not-email`), and one in a flow that hands its run no record of a known object — a schedule, an inbound api call, a record trigger that names no object (`notify-email-field-no-trigger-record`). A trigger object another package declares is not judged.
24
24
25
-
This change is the protocol half. Delivery — resolving the field to an address, the outbound mail configuration, the per-address rate limit and the messaging-log entry — is the messaging service's half and lands separately; until it does, a run that reaches such a node fails at the node.
25
+
This change is the protocol half. Delivery — resolving the field to an address, the outbound mail configuration, the per-address rate limit and the messaging-log entry — ships in the same release in `@objectstack/service-automation`.
fix(app-shell): Browse Marketplace says the catalog could not be reached when the runtime cannot reach it, instead of "the catalog answered with an error (HTTP 502)"
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
-**`@object-ui/app-shell`**: the runtime's marketplace proxy answers `502 MARKETPLACE_PROXY_FAILED` only when its own fetch to the catalog throws. The load-error panel picked its class line by status alone, so that answer read "The marketplace catalog answered with an error (HTTP 502)", with the raw transport text `fetch failed` in full view below it. The panel now reads the error code as well: that code, or no answer at all, reads "The marketplace catalog could not be reached.", and the raw text sits behind a **More** / **Less** disclosure with a copy button. A failure the catalog did answer, including a 502, 503 or 504 relayed from upstream, still names its HTTP status and shows the server's own text. The online hint is unchanged.
fix(fields): a `user` field's person object is always `sys_user` — the user cell and the person picker no longer read an authored `reference`
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A `user` field's target is a constant of its type: `@objectstack/spec` refuses a `user` field whose `reference` names any object but `sys_user`, and `referenceTargetOf` resolves every `user` field to `sys_user` whatever the field carries. The console now agrees with it in two places:
11
+
12
+
-**`UserCellRenderer`** (read-only cell): the field-level read gate on the person's name and avatar is keyed by `sys_user`. A stored object saved before the spec refused a foreign `reference` (for example `reference: 'crm_member'`) used to gate the cell by that object's policy; it is now gated by the `sys_user` policy, the object the runtime expands the field into.
13
+
-**`UserField`** (person picker): the picker targets `sys_user` even when the field carries a foreign `reference`, so it offers users, matching what the runtime stores and resolves.
14
+
15
+
What to do: nothing for a spec-valid `user` field (no `reference`, or `reference: 'sys_user'`). A field that links to another object is a `lookup`.
fix(storage)!: a record write naming a file its caller may not read is refused at the field
6
+
7
+
A record write that names a file its caller may not read is now refused at that field, instead of saving the id as written. The answer is one `400 VALIDATION_FAILED` whose `fields[]` names each such field with the ADR-0114 code `invalid_value`, the same envelope the public form door gives an anonymous submission that carries a file. It names the field only. An id that names no file of the acting organization gets the same answer, so the write cannot tell the two apart. Nothing is claimed, copied or written. System writes and writes with no caller context reference files as before, and an authorization-store outage still fails the write with its declared envelope.
8
+
9
+
A file governed by a record's rule also gets the record-governed link lifetime at the download door.
10
+
11
+
Clause-②: no (narrowing) — a record write that names a file its caller may not read, or an id no file of the organization has, was saved and is now refused. Nothing that was refused becomes accepted.
12
+
13
+
Metadata-protocol: none (a write-time refusal on file fields; nothing a metadata author writes changes)
14
+
15
+
<!-- adr-0087: not-required (no-migration-prescription) No metadata author's surface moves: no spec key or authorable spelling is added, removed, renamed or re-shaped, and no exported declaration is removed or narrowed, so there is nothing for `objectstack migrate meta` to rewrite. What changes is which record writes the file-reference lifecycle accepts: a write naming a file its caller may not read is refused at the field. The remedy is naming a file the caller may read, or leaving the field empty, never a rewrite of a package source or a stored row. The other categories are closed on facts: the package publishes (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); and nothing exported is removed or narrowed (not runtime-interface-only, type-surface-only or runtime-export-retired). -->
16
+
17
+
**BREAKING** for a caller that writes a file id it may not read, shipped as `patch` because the metadata protocol does not move.
18
+
19
+
-**Before.** The write saved, and the field kept an id its readers could not use.
20
+
-**Now.** The write is refused with `400 VALIDATION_FAILED`, naming the field with `invalid_value`.
21
+
-**Fix.** Name a file the caller may read (upload it, or choose one they can open), or leave the field empty.
fix: a sandboxed hook's or action's business refusal is logged once, at info, without a stack
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
When a sandboxed hook or action body refuses on purpose, for example a state-machine hook answered as `422 INVALID_STATE`, the server log used to get two `ERROR [BodyRunner]` lines with full stacks: one at the hook and one again at the action that triggered it. An operator watching for errors could not tell a refused click from a crashed hook.
11
+
12
+
Now a throw that the HTTP doors answer in the 4xx band writes one `info` line, `[BodyRunner] sandboxed hook refused` (or `action refused`), naming the hook or action, its declared `code` and the status, with no stack. The action does not repeat a refusal its hook already logged. A throw that becomes a 5xx (a crash, a denied capability, a declared 5xx) still logs `error` with its stack, at both the hook and the action as before.
13
+
14
+
The refusal-or-fault split is read from the same error table the HTTP doors answer with (`mapDataError`), so the log level follows the status the caller saw. The HTTP status, body and message of every refusal are unchanged, and every throw is still rethrown.
Copy file name to clipboardExpand all lines: content/docs/permissions/access-recipes.mdx
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Pick the layer that matches the requirement:
18
18
|---|---|---|
19
19
| Can read/create/edit/delete an object type | Object CRUD | permission-set `objects.{allowCreate/Read/Edit/Delete}`|
20
20
| Can see / edit a specific field | Field-level security (FLS) | permission-set `fields`, or field `requiredPermissions`|
21
+
| Can no longer edit a field once a record reaches a stage, for some positions only | Row-conditioned FLS | permission-set `fields` entry with `when` ([recipe](#data-lock-fields-for-a-position-once-a-record-reaches-a-stage)) |
21
22
| Which *rows* a user sees | Row-level security (RLS) | permission-set `rowLevelSecurity` (CEL `using` / depth `readScope`) |
| Can open an app / nav entry / page | Surface access |`App.requiredPermissions`, `tabPermissions`, nav gating |
@@ -40,6 +41,51 @@ definePermissionSet({
40
41
- Grants combine **most-permissively** across a user's sets; the tenant-isolation policy `AND`s on top; the superuser bypass (`viewAllRecords` / `modifyAllRecords`) short-circuits RLS where the object's posture allows it (ADR-0066).
41
42
- For genuinely sensitive objects, set `access: { default: 'private' }` so they are **not** covered by blanket wildcard grants — access needs an explicit grant.
42
43
44
+
### Data: lock fields for a position once a record reaches a stage
45
+
46
+
> Finance may edit a contract while it is a draft, but once it is approved the legal terms are frozen for finance. Legal still edits them.
47
+
48
+
Every business app meets this shape: a contract's legal terms after approval, an order's amount after shipping, an invoice after posting, a purchase order's supplier after approval. The answer is a field permission with a **row condition**, `when`, on the permission set that should lose the edit.
49
+
50
+
**In the permission-set editor** (Setup → Access Control → Permission Sets, then open the set):
51
+
52
+
1. Expand the object (`clm_contract`) to show its field rows.
53
+
2. On each field row to lock (`governing_law`, `liability_cap`), keep **Read** on and **Edit** off.
54
+
3. In the row's **When (edit)** column, choose **Add condition** and write the stage condition: `status in ["approved", "signing", "active"]`. The editor lints it like a row-level security clause, and a condition the publish gate would refuse holds the save.
On a row the condition matches, the entry votes as declared (no edit). On every other row the entry is absent, as if the set had not named the field, so a draft stays editable under the object grant.
74
+
75
+
**How to choose:**
76
+
77
+
- The field must freeze for **everyone** at that stage → a [validation rule](/docs/data-modeling/validation) on the object. It refuses the write whoever sends it.
78
+
- The field freezes depending on **who** is editing → a field permission with `when` on the sets that lose the edit, as above.
79
+
80
+
**Boundaries:**
81
+
82
+
-**Edit only, never read.** The condition narrows the edit vote; reads are judged row-blind. Keep `readable: true` on the entry: `readable: false` beside a `when` is refused at parse time.
83
+
-**Same object only.** The condition names fields of the entry's own object (compared with a literal or a `current_user.*` value). A condition that reaches across a relation, or names a field the object lacks, is refused at authoring and publish.
84
+
-**The record before the write.** On an update the condition reads the stored record, so a write cannot unlock itself by moving `status` back in the same request. On an insert it reads the record as sent.
85
+
-**It locks, it does not grant.** Grants merge most-permissively: if the same user holds another set that grants the edit, that grant still wins and the field stays editable. Grant the edit only in the sets that should keep it. A subtractive deny layer is [not yet implemented](/docs/permissions/authorization#combination-semantics-the-fixed-order).
86
+
87
+
Full semantics, including how a write with no judgeable row is treated: [Row-conditioned edit locks](/docs/permissions/field-level-security#row-conditioned-edit-locks-when).
88
+
43
89
### Automation: the run-identity is the safety decision
0 commit comments