Skip to content

Commit c21920a

Browse files
committed
test(rest,runtime): the every-type org-scope fixtures hold the datasource write capability
Claude-Session: https://claude.ai/code/session_01MRdbfpy4sQT8bUjmMhxsN7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7cea2ee commit c21920a

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎packages/rest/src/rest-server-meta-org-scope-url-spelling.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ function boot(execCtx: any) {
132132
/** The request object the route handed to the protocol. */
133133
const requestFrom = (fn: any) => fn.mock.calls[0][0];
134134

135-
const AUTHORIZED = { userId: 'u1', systemPermissions: ['manage_metadata'], tenantId: ORG };
135+
// [#21124] `manage_platform_settings` too: these suites iterate every registered type, and a
136+
// `datasource` write is admitted only with it (`metaTypeWriteRefusal`, the type-level write admission).
137+
const AUTHORIZED = { userId: 'u1', systemPermissions: ['manage_metadata', 'manage_platform_settings'], tenantId: ORG };
136138

137139
async function writeWith(type: string) {
138140
const b = boot(AUTHORIZED);

‎packages/rest/src/rest-server-meta-write-org-scope.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ function boot(execCtx: any) {
126126
/** The request object the route handed to the protocol. */
127127
const requestFrom = (fn: any) => fn.mock.calls[0][0];
128128

129-
const AUTHORIZED = { userId: 'u1', systemPermissions: ['manage_metadata'], tenantId: ORG };
130-
const AUTHORIZED_NO_ORG = { userId: 'u1', systemPermissions: ['manage_metadata'] };
129+
// [#21124] `manage_platform_settings` too: these suites iterate every registered type, and a
130+
// `datasource` write is admitted only with it (`metaTypeWriteRefusal`, the type-level write admission).
131+
const AUTHORIZED = { userId: 'u1', systemPermissions: ['manage_metadata', 'manage_platform_settings'], tenantId: ORG };
132+
const AUTHORIZED_NO_ORG = { userId: 'u1', systemPermissions: ['manage_metadata', 'manage_platform_settings'] };
131133

132134
/** Drive one write door with the given type + execution context. */
133135
async function writeWith(type: string, execCtx: any) {

‎packages/runtime/src/meta-write-org-scope.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,12 @@ const ctx = (activeOrganizationId?: string): any => ({
263263
// dropped). The dispatcher's `/meta` doors scope by THIS value — the vetted
264264
// one `RestServer`'s doors read — never the claim as stored, so a case whose
265265
// session has an active organization hands the same one in here.
266+
// [#21124] `manage_platform_settings` too: the URL-contract case below drives
267+
// every registered type, and a `datasource` write is admitted only with it
268+
// (`metaTypeWriteRefusal`, the type-level write admission).
266269
executionContext: {
267270
userId: 'usr_1',
268-
systemPermissions: ['manage_metadata'],
271+
systemPermissions: ['manage_metadata', 'manage_platform_settings'],
269272
...(activeOrganizationId ? { tenantId: activeOrganizationId } : {}),
270273
},
271274
});

0 commit comments

Comments
 (0)