|
25 | 25 | import { describe, it, expect, beforeAll, afterAll } from 'vitest'; |
26 | 26 | import { type VerifyStack } from '@objectstack/verify'; |
27 | 27 | import { bootShowcase } from './showcase-boot.js'; |
28 | | -import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js'; |
29 | 28 |
|
30 | 29 | // Sharing-rule routes are anchored on the API base, not under `/data/:object` |
31 | 30 | // (they administer rules tenant-wide) — `/api/v1/sharing/rules`. |
@@ -153,11 +152,13 @@ describe('#3896 — a sharing rule POSTed without criteria is rejected, never ma |
153 | 152 | const id = 'srule_3896_legacy'; |
154 | 153 | const driver = (ql as any).getDriverForObject('sys_sharing_rule'); |
155 | 154 | expect(driver, 'sys_sharing_rule driver must be resolvable').toBeTruthy(); |
156 | | - // That residue lives only on a store built before 18.x, whose tenant column is |
157 | | - // nullable (ADR-0131 D1 makes a fresh one NOT NULL): the table is that store's. |
158 | | - await relaxTenantColumns(ql as any, ['sys_sharing_rule']); |
| 155 | + // The legacy row belongs to the install's organization, as every row does |
| 156 | + // since the ownership ceremony (ADR-0131 D1): its missing criteria is the |
| 157 | + // subject here, not its owner. |
| 158 | + const [organization] = (await ql.find('sys_organization', { context: SYS })) as Array<{ id: string }>; |
159 | 159 | await driver.create('sys_sharing_rule', { |
160 | 160 | id, |
| 161 | + organization_id: organization.id, |
161 | 162 | name: 'legacy_match_all_3896', |
162 | 163 | label: 'Legacy match-all', |
163 | 164 | object_name: OBJECT, |
|
0 commit comments