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 ac14915
Browse filesBrowse the repository at this point in the historyBrowse files
fix(objectql): an organization delete removes its units of measure
The organization delete's own cascade removes the organization's sys_unit
rows, retired ones included, once the delete is admitted: the one exemption
from the sys_unit delete refusal (ruling 7035627429, option B). The
exemption is the engine's own cascade token, issued only by the removal and
claimed by the delete it names, so every other unit delete is still refused
405 ERR_UNIT_DELETE_REFUSED, for a user, a system writer and an automation
run, by id and batched, a hook's delete during the removal included. Units
no longer count as records that keep an organization from being deleted.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
fix(objectql): deleting an organization also deletes its units of measure, the one exemption from the `sys_unit` delete refusal
6
+
7
+
Clause-②: yes
8
+
Metadata-protocol: none
9
+
10
+
An organization that had ever created a unit of measure could not be deleted: the delete was refused with 409 `DELETE_RESTRICTED` naming `sys_unit`, and the units could not be removed first, because the engine refuses every delete of a unit (405 `ERR_UNIT_DELETE_REFUSED`). Now the organization delete's own cascade removes that organization's `sys_unit` rows, retired ones included, through the engine's delete path, after the delete has been admitted, so no unit row is left naming a deleted organization. `organizationOwnedRowCounts` (the question plugin-auth's organization delete asks first) and the engine's own refusal no longer count units as records the organization still owns.
11
+
12
+
**Declared behaviour change.** A delete door widens, in one place only. A delete of an organization that holds units and no other record now succeeds and removes the units; before, it was refused. An organization that owns any other record is still refused, and none of its units is removed. Every other delete of a unit is still refused with 405 `ERR_UNIT_DELETE_REFUSED`, by id and batched, for a user, a system writer and an automation run, including a delete issued by a hook while the organization's delete is running: the exemption is recognised from the engine's own cascade, never from anything a caller passes. Retire a unit (`retired: true`) to stop its use, as before.
0 commit comments