Skip to content

Commit 31189e7

Browse files
committed
test(plugin-security): main's delegated-membership, update-seam and every-row-master fixtures meet a NOT NULL tenant column
Their organization-less permission-set (and, for the update seam, position) catalogue rows are legacy residue, so each suite relaxes only those tables to the pre-18 shape. No assertion changed. Claude-Session: https://claude.ai/code/session_018EszgtA3V2KXBX5tf59Hi4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent cceb73d commit 31189e7

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/plugins/plugin-security/src/controlled-by-parent-every-row-master.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { SysUserPosition } from './objects/sys-user-position.object.js';
6161
import { SysUserPermissionSet } from './objects/sys-user-permission-set.object.js';
6262
import { SecurityPlugin } from './security-plugin.js';
6363
import { defaultPermissionSets } from './objects/default-permission-sets.js';
64+
import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js';
6465

6566
const SYS = { context: { isSystem: true } } as never;
6667
const ORG = 'org_cbp_erm';
@@ -164,6 +165,10 @@ async function boot() {
164165
],
165166
} as never);
166167
await engine.syncSchemas();
168+
// The organization-less permission-set catalogue row below exists only on a
169+
// store built before 18.x (ADR-0131 D1 makes a fresh tenant column NOT
170+
// NULL): that table is this store's.
171+
await relaxTenantColumns(engine as never, ['sys_permission_set']);
167172

168173
const e = engine as unknown as {
169174
insert: (o: string, row: Record<string, unknown>, opts: never) => Promise<unknown>;

‎packages/plugins/plugin-security/src/delegated-organization-membership.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { SysOrganization, SysUser, SysMember } from '@objectstack/platform-objec
5050
import { SysPosition, SysPermissionSet, SysPositionPermissionSet } from './__tests__/legacy-catalog-objects.testkit.js';
5151
import { SysUserPosition } from './objects/sys-user-position.object.js';
5252
import { SysUserPermissionSet } from './objects/sys-user-permission-set.object.js';
53+
import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js';
5354

5455
const ORG_A = 'org_a';
5556
const ORG_C = 'org_c';
@@ -134,6 +135,10 @@ async function boot(posture: Posture) {
134135
],
135136
} as never);
136137
await engine.syncSchemas();
138+
// The organization-less permission-set catalogue row below exists only on a
139+
// store built before 18.x (ADR-0131 D1 makes a fresh tenant column NOT
140+
// NULL): that table is this store's.
141+
await relaxTenantColumns(engine as never, ['sys_permission_set']);
137142
engines.push(engine);
138143

139144
for (const id of [ORG_A, ORG_C, ORG_D]) {

‎packages/plugins/plugin-security/src/update-seam-judges-organization.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { SysOrganization, SysUser, SysMember } from '@objectstack/platform-objec
5050
import { SysPosition, SysPermissionSet, SysPositionPermissionSet } from './__tests__/legacy-catalog-objects.testkit.js';
5151
import { SysUserPosition } from './objects/sys-user-position.object.js';
5252
import { SysUserPermissionSet } from './objects/sys-user-permission-set.object.js';
53+
import { relaxTenantColumns } from './pre-18-tenant-column.testkit.js';
5354

5455
const OWN_ORG = 'org_a';
5556
const SISTER_ORG = 'org_c';
@@ -145,6 +146,10 @@ async function boot(posture: Posture) {
145146
],
146147
} as never);
147148
await engine.syncSchemas();
149+
// The organization-less permission-set and position catalogue rows below
150+
// exist only on a store built before 18.x (ADR-0131 D1 makes a fresh tenant
151+
// column NOT NULL): those tables are this store's.
152+
await relaxTenantColumns(engine as never, ['sys_permission_set', 'sys_position']);
148153
engines.push(engine);
149154

150155
for (const id of [OWN_ORG, SISTER_ORG, FOREIGN_ORG]) {

0 commit comments

Comments
 (0)