An administrator gave a notebook to another owner by updating ownerUserId on the notebook, a field the table declares not editable; NotebookTableCustomizer let an administrator through. QQQ core is gaining a rule (QRun-IO/qqq pull requests 1382 and 1383, in review): a person's update that changes a field that is not editable is refused with 400. Under that rule the transfer stops working.
The choice: a transfer is an action, not an edit
New record action Transfer Notebook (sqlWorkbenchTransferNotebook, on a notebook, admin permission). The field stays not editable.
Why this and not "declare the field editable and keep the customizer as the guard":
No client needs a special case. Core has no "editable for some people": a field is editable or it is not. Declared editable, every client (web, terminal, command line) would offer every non-administrator an input for the owner that the server then refuses. As a process, the action appears, with its form, only to those who hold the permission, through the process list every client already renders.
It leaves a record of the transfer.NotebookService.transfer appends a version "Transferred from A to B", saved by the administrator, in the same transaction as the change; the QQQ record audit (where a host has audit tables) carries the same note. The old way left only "Record was edited".
One behaviour on every core. The customizer now refuses a save that would change the owner, for everyone, with a message naming the action. So a core with the rule and a core without it answer an administrator's PATCH of the owner the same way (400), and the action works on both because it is the qbit's own write (system input source, in the administrator's session, so the record locks still apply), not a person's edit.
Changes
SqlWorkbenchRecordActionsMetaDataProducer: the process, with one form field newOwnerUserId (required).
NotebookService.transfer: checks the admin permission whatever the entry point, a new owner that is present, not too long and not the current one; updates the owner and appends the version in one transaction.
NotebookTableCustomizer: a change of ownerUserId without the OWNER_TRANSFER action flag (set in Java only) is bad input. A save that sends the stored owner back is stored, as before.
Help bundle, README, DESIGN, CHANGELOG, UPGRADE.
Tests
NotebookTransferHttpTest, over real HTTP (Javalin, the UI API's own process and table routes):
an administrator runs the action: owner and owner name change, a version records who, from whom and to whom, the previous owner gets 404, the new owner saves;
no save sets the owner: an administrator's PATCH is 400 and nothing of it is stored (not even a title sent with it); the owner's is refused too; a whole record sent back with the stored owner and a new title is stored;
only an administrator runs the action: the owner, another workbench user and a user without access get 403 from the process route, and the service refuses a non-administrator who reaches it another way;
a blank, too long or unchanged new owner, and a notebook that does not exist, are refused with a reason and change nothing.
Run locally:
CI=true ./mvnw -B clean verify on this branch against the pinned core (4.1.0-RC.26): green, 155 unit and 10 integration tests, coverage and guardrails met.
The same test class, and the whole unit suite, against a core built locally from the release/4.1 branch of the rule (version overridden on the command line in a scratch Maven repository; nothing of that is committed): NotebookTransferHttpTest passes; the only failures in the suite are the TableSecurityMatrixTest expectations listed below.
What a host or a client must change
A client or script that changed the owner with a table update must run the process (UPGRADE.md has the two requests). Nothing to grant: the action uses the admin permission administrators already hold.
A client that sends a whole record back on save, with the stored owner, needs no change.
Follow-up for the day this qbit moves to a core with the rule
Not changed here, because the pinned core does not behave this way. TableSecurityMatrixTest (line numbers as of this branch) expects five things that core will change; with these five edits the class passes against the rule's release/4.1 branch (checked in a scratch copy):
348-350 (testWriteMatrix): an insert of a notebook that carries ownerUserId and visibility is refused (Owner User Id cannot be set. and Visibility cannot be set.); today it is stored with both overwritten. Expect the refusal, and that no notebook was created.
386-388 (testAppendOnlyAndPinnedResults): the tables have no insert, update or delete capability, so core answers before the customizer. The update (386) and the insert (388) still throw; the delete (387) throws QPermissionDeniedException (Records of SQL Notebook Version cannot be deleted.) where it returned a count of 0.
395-396: inserting a pinned result is refused by the capability (Records cannot be added to SQL Result Snapshot., a QPermissionDeniedException), not with the customizer's "pinned from the notebook".
443-444 (testTableEditsKeepNotebookInvariants): an update that carries currentVersion: 99 is refused (Current Version cannot be changed.); today the value is dropped and the description is saved. Send the description alone (version 5 as before) and assert the refusal separately.
584-585, 598 (testShareEdits): an update of a share that carries audienceKey and createdByUserId is refused (Audience Key cannot be changed. and Created By User Id cannot be changed.); today both are dropped. Send audienceId alone; 598 still holds but no longer shows a forged value being ignored, so assert the refusal.
After the move, the lines in the customizers that silently drop currentVersion, createDate, ownerName, audienceKey and createdBy* from a person's update are reached only for values equal to the stored ones, and can go.
## What
An administrator gave a notebook to another owner by updating `ownerUserId` on the notebook, a field the table declares not editable; `NotebookTableCustomizer` let an administrator through. QQQ core is gaining a rule (QRun-IO/qqq pull requests 1382 and 1383, in review): a person's update that changes a field that is not editable is refused with 400. Under that rule the transfer stops working.
## The choice: a transfer is an action, not an edit
New record action **Transfer Notebook** (`sqlWorkbenchTransferNotebook`, on a notebook, admin permission). The field stays not editable.
Why this and not "declare the field editable and keep the customizer as the guard":
- **No client needs a special case.** Core has no "editable for some people": a field is editable or it is not. Declared editable, every client (web, terminal, command line) would offer every non-administrator an input for the owner that the server then refuses. As a process, the action appears, with its form, only to those who hold the permission, through the process list every client already renders.
- **It leaves a record of the transfer.** `NotebookService.transfer` appends a version "Transferred from A to B", saved by the administrator, in the same transaction as the change; the QQQ record audit (where a host has audit tables) carries the same note. The old way left only "Record was edited".
- **One behaviour on every core.** The customizer now refuses a save that would change the owner, for everyone, with a message naming the action. So a core with the rule and a core without it answer an administrator's `PATCH` of the owner the same way (400), and the action works on both because it is the qbit's own write (system input source, in the administrator's session, so the record locks still apply), not a person's edit.
## Changes
- `SqlWorkbenchRecordActionsMetaDataProducer`: the process, with one form field `newOwnerUserId` (required).
- `NotebookService.transfer`: checks the admin permission whatever the entry point, a new owner that is present, not too long and not the current one; updates the owner and appends the version in one transaction.
- `NotebookTableCustomizer`: a change of `ownerUserId` without the `OWNER_TRANSFER` action flag (set in Java only) is bad input. A save that sends the stored owner back is stored, as before.
- Help bundle, README, DESIGN, CHANGELOG, UPGRADE.
## Tests
`NotebookTransferHttpTest`, over real HTTP (Javalin, the UI API's own process and table routes):
- an administrator runs the action: owner and owner name change, a version records who, from whom and to whom, the previous owner gets 404, the new owner saves;
- no save sets the owner: an administrator's `PATCH` is 400 and nothing of it is stored (not even a title sent with it); the owner's is refused too; a whole record sent back with the stored owner and a new title is stored;
- only an administrator runs the action: the owner, another workbench user and a user without access get 403 from the process route, and the service refuses a non-administrator who reaches it another way;
- a blank, too long or unchanged new owner, and a notebook that does not exist, are refused with a reason and change nothing.
Run locally:
- `CI=true ./mvnw -B clean verify` on this branch against the pinned core (4.1.0-RC.26): green, 155 unit and 10 integration tests, coverage and guardrails met.
- The same test class, and the whole unit suite, against a core built locally from the `release/4.1` branch of the rule (version overridden on the command line in a scratch Maven repository; nothing of that is committed): `NotebookTransferHttpTest` passes; the only failures in the suite are the `TableSecurityMatrixTest` expectations listed below.
## What a host or a client must change
- A client or script that changed the owner with a table update must run the process (UPGRADE.md has the two requests). Nothing to grant: the action uses the admin permission administrators already hold.
- A client that sends a whole record back on save, with the stored owner, needs no change.
## Follow-up for the day this qbit moves to a core with the rule
Not changed here, because the pinned core does not behave this way. `TableSecurityMatrixTest` (line numbers as of this branch) expects five things that core will change; with these five edits the class passes against the rule's `release/4.1` branch (checked in a scratch copy):
1. **348-350** (`testWriteMatrix`): an insert of a notebook that carries `ownerUserId` and `visibility` is refused (`Owner User Id cannot be set. and Visibility cannot be set.`); today it is stored with both overwritten. Expect the refusal, and that no notebook was created.
2. **386-388** (`testAppendOnlyAndPinnedResults`): the tables have no insert, update or delete capability, so core answers before the customizer. The update (386) and the insert (388) still throw; the delete (387) throws `QPermissionDeniedException` (`Records of SQL Notebook Version cannot be deleted.`) where it returned a count of 0.
3. **395-396**: inserting a pinned result is refused by the capability (`Records cannot be added to SQL Result Snapshot.`, a `QPermissionDeniedException`), not with the customizer's "pinned from the notebook".
4. **443-444** (`testTableEditsKeepNotebookInvariants`): an update that carries `currentVersion: 99` is refused (`Current Version cannot be changed.`); today the value is dropped and the description is saved. Send the description alone (version 5 as before) and assert the refusal separately.
5. **584-585, 598** (`testShareEdits`): an update of a share that carries `audienceKey` and `createdByUserId` is refused (`Audience Key cannot be changed. and Created By User Id cannot be changed.`); today both are dropped. Send `audienceId` alone; 598 still holds but no longer shows a forged value being ignored, so assert the refusal.
After the move, the lines in the customizers that silently drop `currentVersion`, `createDate`, `ownerName`, `audienceKey` and `createdBy*` from a person's update are reached only for values equal to the stored ones, and can go.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
An administrator gave a notebook to another owner by updating ownerUserId, a
field the table declares not editable; the notebook customizer let it through.
A QQQ core that refuses a person's write of a field that is not editable
refuses that save, so the transfer stops working there.
A transfer is an action, not an edit. New record action
sqlWorkbenchTransferNotebook on a notebook, for holders of the admin
permission: NotebookService.transfer checks the administrator again, writes
the owner as the qbit's own write (system input source) in the
administrator's session, with the record locks, and appends a version
"Transferred from A to B" saved by the administrator; the record audit
carries the same note. The field stays not editable, so every client shows it
read-only and none needs a special case.
The customizer now refuses a save that would change the owner, for everyone,
with a message naming the action, so the behaviour is the same on a core with
the rule and on one without. A save that sends the stored owner back is
stored.
Tests over real HTTP (the UI API process and table routes):
NotebookTransferHttpTest. They pass on the pinned core and on a locally built
core with the rule.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
An administrator gave a notebook to another owner by updating
ownerUserIdon the notebook, a field the table declares not editable;NotebookTableCustomizerlet an administrator through. QQQ core is gaining a rule (QRun-IO/qqq pull requests 1382 and 1383, in review): a person's update that changes a field that is not editable is refused with 400. Under that rule the transfer stops working.The choice: a transfer is an action, not an edit
New record action Transfer Notebook (
sqlWorkbenchTransferNotebook, on a notebook, admin permission). The field stays not editable.Why this and not "declare the field editable and keep the customizer as the guard":
NotebookService.transferappends a version "Transferred from A to B", saved by the administrator, in the same transaction as the change; the QQQ record audit (where a host has audit tables) carries the same note. The old way left only "Record was edited".PATCHof the owner the same way (400), and the action works on both because it is the qbit's own write (system input source, in the administrator's session, so the record locks still apply), not a person's edit.Changes
SqlWorkbenchRecordActionsMetaDataProducer: the process, with one form fieldnewOwnerUserId(required).NotebookService.transfer: checks the admin permission whatever the entry point, a new owner that is present, not too long and not the current one; updates the owner and appends the version in one transaction.NotebookTableCustomizer: a change ofownerUserIdwithout theOWNER_TRANSFERaction flag (set in Java only) is bad input. A save that sends the stored owner back is stored, as before.Tests
NotebookTransferHttpTest, over real HTTP (Javalin, the UI API's own process and table routes):PATCHis 400 and nothing of it is stored (not even a title sent with it); the owner's is refused too; a whole record sent back with the stored owner and a new title is stored;Run locally:
CI=true ./mvnw -B clean verifyon this branch against the pinned core (4.1.0-RC.26): green, 155 unit and 10 integration tests, coverage and guardrails met.release/4.1branch of the rule (version overridden on the command line in a scratch Maven repository; nothing of that is committed):NotebookTransferHttpTestpasses; the only failures in the suite are theTableSecurityMatrixTestexpectations listed below.What a host or a client must change
Follow-up for the day this qbit moves to a core with the rule
Not changed here, because the pinned core does not behave this way.
TableSecurityMatrixTest(line numbers as of this branch) expects five things that core will change; with these five edits the class passes against the rule'srelease/4.1branch (checked in a scratch copy):testWriteMatrix): an insert of a notebook that carriesownerUserIdandvisibilityis refused (Owner User Id cannot be set. and Visibility cannot be set.); today it is stored with both overwritten. Expect the refusal, and that no notebook was created.testAppendOnlyAndPinnedResults): the tables have no insert, update or delete capability, so core answers before the customizer. The update (386) and the insert (388) still throw; the delete (387) throwsQPermissionDeniedException(Records of SQL Notebook Version cannot be deleted.) where it returned a count of 0.Records cannot be added to SQL Result Snapshot., aQPermissionDeniedException), not with the customizer's "pinned from the notebook".testTableEditsKeepNotebookInvariants): an update that carriescurrentVersion: 99is refused (Current Version cannot be changed.); today the value is dropped and the description is saved. Send the description alone (version 5 as before) and assert the refusal separately.testShareEdits): an update of a share that carriesaudienceKeyandcreatedByUserIdis refused (Audience Key cannot be changed. and Created By User Id cannot be changed.); today both are dropped. SendaudienceIdalone; 598 still holds but no longer shows a forged value being ignored, so assert the refusal.After the move, the lines in the customizers that silently drop
currentVersion,createDate,ownerName,audienceKeyandcreatedBy*from a person's update are reached only for values equal to the stored ones, and can go.🤖 Generated with Claude Code