Skip to content

Commit ad748b9

Browse files
committed
docs(runtime): the declarative update docblock names the object-level 403 ahead of the not-found pair
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czxVZYV4CcMiCbofw3
1 parent 8b12303 commit ad748b9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎.changeset/30848-declarative-update-refusal-order.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
fix(runtime): a declarative update action refuses a caller with no edit grant `403 PERMISSION_DENIED`, as the data door does, whether or not the record exists or is visible to them
66

7-
Clause-②: no — no request that succeeded is refused and no shape changes: one refusal's code moves from `404 RECORD_NOT_FOUND` to the data door's `403 PERMISSION_DENIED`, for a caller who may not update the object
7+
Clause-②: no
88
Metadata-protocol: none
99

1010
An `operation: 'update'` action (REST `POST /actions/:object/:action/:id`, MCP `run_action`) now judges the caller's update permission on the object before it answers on the record lookup, the order the data door already keeps ("Refusals come before the record lookup"). A caller who may read the object but holds no edit grant on it, writing a record their access hides or an id that names no record, was answered `404 RECORD_NOT_FOUND` by the action and `403 PERMISSION_DENIED` by `PATCH /data` and MCP `update_record` for the same write. Both doors now answer `403 PERMISSION_DENIED`, with the data door's sentence.
1111

1212
A caller who may update the object keeps `404 RECORD_NOT_FOUND`, one answer for a hidden record and a missing id, so neither door tells a caller whether a record it cannot see exists. A record the caller can read but not edit was already answered `403` by both doors and is unchanged.
13+
14+
No request that succeeded is refused, and no shape changes: for a caller who may not update the object, one refusal's code moves from `404 RECORD_NOT_FOUND` to the data door's `403 PERMISSION_DENIED`.

‎packages/runtime/src/action-execution.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4171,6 +4171,11 @@ function declarativeUpdateRefusal(message: string, status: number): Error {
41714171
* inventing a 403 for the pair would answer a question the platform declines to
41724172
* answer everywhere else. See the note on `loadActionSubjectRecord`.
41734173
*
4174+
* [#30848] Except for a caller who may not update the OBJECT at all: the data
4175+
* door refuses that write `403` before it looks the record up, so the pair
4176+
* gets that 403 here too ({@link refuseUngrantedDeclarativeUpdate}), one
4177+
* answer for both members of the pair, and the pair stays undistinguished.
4178+
*
41744179
* ## What is NOT checked here
41754180
*
41764181
* `visible` — contract point 6. It is a per-record UI predicate the client

0 commit comments

Comments
 (0)