Skip to content

Commit d5f3bc5

Browse files
fix(core): lower modifyAllRecords in the managed write clamp where the write guard refuses edit or delete (#30474)
domain:server#3 · os-bill · session_01Utp6CZUqByp4kJMhCQDWZ2 <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgJHeo7w1wp7HQ5HRJRCx6FL)_ Fixes #30440 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:受管对象(better-auth / engine-owned / append-only)的权限视图里,显式的「修改全部记录」在写守卫拒绝编辑或删除时被降为「查看全部记录」,并保留对象仍开放的动作;未开放编辑的对象上「转移」也一并清掉(超级管理员之前在这些对象上被告知可以转移)。 - 为什么改:之前只要权限集写了 modifyAllRecords,`current_user.can()` 和控制台按钮就说可以编辑、删除、转移,但写守卫实际一律拒绝。 - 风险与回滚:只改服务端返回的能力答案,不改任何写入的放行与拒绝;回滚即还原本 PR 的单个函数。 - 先看:`packages/core/src/security/effective-object-permissions.ts` 的 `clampManagedObjectWrites` 与新 helper `lowerModifyAllRecords`;`packages/plugins/plugin-security/src/get-effective-object-permissions.test.ts` 一致性表的 `CLAMPED` 与新行;测试块 `[#30440]`。 - 两分钟验证:`pnpm --filter @objectstack/core exec vitest run src/security/effective-object-permissions.test.ts`,预期 55 个全绿。 - 需要你做的:无,席位落地。 ## What changes `clampManagedObjectWrites` (`packages/core/src/security/effective-object-permissions.ts`) cleared `allowEdit` / `allowCreate` / `allowDelete` on an object in a guarded `managedBy` bucket that does not opt the verb in through `userActions`, but never touched `modifyAllRecords`, which the spec's `objectPermissionGrants` reads as edit, delete and transfer on its own. A permission set naming such an object with `{ modifyAllRecords: true }` therefore answered `current_user.can(object, 'edit' | 'delete' | 'transfer')` true while the write guard refused every one of those writes. - New private helper `lowerModifyAllRecords(acc, kept)`: when the entry carries `modifyAllRecords: true` and a layer refuses at least one of edit / delete / transfer, the bit becomes `false`, `viewAllRecords` becomes `true` (the read it implies, so read is unchanged), and each verb `kept` names is carried over as its plain `allow*` bit. - `clampManagedObjectWrites` calls it with `{ allowEdit: edit, allowDelete: delete, allowTransfer: edit }` from the object's `userActions` opt-ins. - **Claim amendment 6658639729 (seat):** `clampManagedObjectWrites` also clears a plain `allowTransfer` on a guarded object that does not opt `edit` in. The super-user wildcard fold copies the transfer bit `modifyAllRecords` grants onto every entry it covers, so the shipped platform admin was served `can(object, 'transfer')` true on every such object while the guard refused the update. Measured on `c5800818`: an engine-owned object opting nothing in, wildcard `{ allowRead, viewAllRecords, modifyAllRecords }`, map entry `allowTransfer: true`, and `assertEngineOwnedWriteAllowed(…, 'update', user)` throws `PermissionDeniedError`. After the fix the same probe answers transfer `false`. - **Same amendment, the agreement table** in `packages/plugins/plugin-security/src/get-effective-object-permissions.test.ts` (can() over the served map vs `PermissionEvaluator.checkObjectPermission`, which does not model the guard): its `CLAMPED` set, the cells it forgives in the refuse direction on a guarded object, gains `allowTransfer`, and it gains a row `[#30440] explicit modifyAllRecords entries on guarded managed objects` (`sys_user` opting edit in, `sys_member` opting nothing in, private `sys_secret`). - `clampExternalReadOnlyWrites` (#30370, PR #30416) now goes through the same helper with nothing kept; its behaviour is byte-identical (its existing tests are unchanged and green). **The partial opt-in choice (dispatch scope item 2).** `objectPermissionGrants` answers edit as `read && (allowEdit || modifyAll)`, delete as `read && (allowDelete || modifyAll)` and transfer as `allowTransfer || modifyAll`, so a `false` beside `modifyAllRecords` takes nothing away: an entry cannot keep `modifyAllRecords` and refuse only delete. So: | object opts in | `modifyAllRecords` | served `can()` | |:--|:--|:--| | nothing (`sys_automation_run`, `http_delivery`) | lowered to `viewAllRecords` | read only | | `edit` only (`sys_user`, `sys_organization`, `sys_api_key`) | lowered; `allowEdit` + `allowTransfer` kept | read, edit, transfer; no delete | | `edit` and `delete` | kept | unchanged | Transfer follows `edit` because an owner change is an update: the engine-owned guard maps it to the `edit` affordance, and #30416's external clamp already treats it the same way. What is lost when the bit is lowered on an `edit`-only object is record-level "all records" scope for edit, which only the server evaluator reads (unchanged here); the served map's consumers read the object-level verbs (`current_user.can`, `MePermissionsProvider`'s transfer check), and those keep edit and transfer. ## Tests New block `[#30440] a guarded managed object grants no verb its write guard refuses, modifyAllRecords included` in `packages/core/src/security/effective-object-permissions.test.ts` (the existing harness file for this map), through `buildEffectiveObjectPermissions` and the spec's real `objectPermissionGrants`: - explicit `{ modifyAllRecords: true }` on an engine-owned object opting nothing in: no edit / delete / transfer, same read; - the same on a `sys_user`-shaped object (edit opted in): edit and transfer kept, delete gone; - an object opting edit and delete in keeps `modifyAllRecords`; - CONTROL: the same entry on an unguarded object keeps every verb `modifyAllRecords` grants; - a plain `allowTransfer` on an object not opting edit in answers no transfer; on `sys_user` (edit opted in) it stays; - CONTROL: the super-user wildcard fold answers exactly as on `main` on every object except the folded transfer bit on the object opting nothing in, which now reads `false` (the fold copies granted bits, never `modifyAllRecords`). plugin-security's agreement table: one new row (above) and `allowTransfer` in `CLAMPED`; 68/68. ## Acceptance notes - The `allowTransfer` half was first handed back as out of scope (first commit `47fe789a` cleared it and red 13 rows of the agreement table; `5dd16ba3` took it out); the seat chose to take it here and amended the claim (6658639729); `04b5cbbe` puts it back with the table change. - Observation, not filed: on the same measurement `apiOperations` for the engine-owned object lists `create` / `update` / `delete`. That annotation reads `enable.apiMethods` exposure, a different layer from the guard; noted only. ## Verification <details><summary>Measured on main first (c580081), probe deleted after use</summary> ``` PROBE map probe_engine_owned = {"modifyAllRecords":true,"allowEdit":false,"allowCreate":false,"allowDelete":false,…} · can: allowRead=true allowCreate=false allowEdit=true allowDelete=true allowTransfer=true PROBE map sys_user_like = {"modifyAllRecords":true,"allowCreate":false,"allowDelete":false,…} · can: allowRead=true allowCreate=false allowEdit=true allowDelete=true allowTransfer=true PROBE guard probe_engine_owned update: REFUSED PermissionDeniedError [Security] Access denied: 'probe_engine_owned' is engine-owned (managedBy:'engine-owned', … PROBE guard probe_engine_owned delete: REFUSED PermissionDeniedError … ``` The same probe after the fix: `probe_engine_owned` can edit/delete/transfer = false/false/false, read true; `sys_user_like` edit/delete/transfer = true/false/true; the unguarded control unchanged. </details> <details><summary>Tests and ablation</summary> - `pnpm --filter @objectstack/core test`: Test Files 134 passed, Tests 3001 passed (lock VERDICT command-exit 0); `pnpm --filter @objectstack/plugin-security typecheck` exit 0. - `pnpm --filter @objectstack/core typecheck`: exit 0, test layer OK. - Downstream readers of the map, run against the rebuilt core: plugin-hono-server `current-user-endpoints-effective-objects.test.ts` + `fold-wildcard-superuser.test.ts` 20/20; plugin-security `get-effective-object-permissions.test.ts` 68/68. - Ablation (`scripts/ablation-replace.mjs --delete` of the `lowerModifyAllRecords(…)` call in `clampManagedObjectWrites`; anchor 1 → 0 on disk; the test imports the source module relatively, so no `dist/` leg): on `5dd16ba3`, 2 failed / 52 passed, the two explicit-`modifyAllRecords` cases; restored blob equals HEAD, `git diff HEAD` empty. - Ablation 2 on `04b5cbbe` (`--delete` of `if (!edit) acc.allowTransfer = false;`, core rebuilt, `ablation-dist-preflight --absent` confirmed the marker gone from all 14 dist files): core file 2 failed / 53 passed (the plain-transfer case and the wildcard CONTROL); the agreement table stays 68/68, as expected: without the clear the map is broader, the evaluator agrees, and the table only flags the refuse direction. Restored blob equals HEAD; core rebuilt, preflight finds the marker back in `dist/index.js` and `dist/index.cjs`. - Ablation 3 on `04b5cbbe` (the table's `CLAMPED` back to create / edit / delete): 14 failed / 54 passed, the 13 super-user rows on `sys_member.transfer` / `sys_secret.transfer` plus the new `[#30440]` row; restored blob equals HEAD. </details> <details><summary>Derived gate families on head 04b5cbb: 62 derived, 62 run exit 0</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 62 commands from the 4 changed paths (146 changed lines); each was run on `04b5cbbe` and its exit code recorded before any pipe; `--ran` reconciles: "62 derived famil(ies) accounted for, 62 run, 0 NOT-MEASURED". The amendment's test file added `check-tenant-audit-census` (+ `--self-test`), `check:i18n` and `check:i18n-stale-fill`. - `pnpm check:dual-build-cjs-loads` (NOT MEASURED on `5dd16ba3`) now exit 0: 116 require entry points across 71 packages load. - `node scripts/check-plugin-teardown-shape.mjs --self-test` exit 0 (48 cases) after `git fetch origin 621a487` on the shallow clone. - Also run on `5dd16ba3`: `pnpm --filter @objectstack/spec check:liveness` exit 0 (no spec path in the diff). - Not in the local set, left to CI: the type-check lanes, Build Core, Test Core shards, and the repo-wide scans. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CZUqByp4kJMhCQDWZ2)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c23eafa commit d5f3bc5

4 files changed

Lines changed: 137 additions & 9 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/core': patch
3+
---
4+
5+
fix(core): effective object permissions on a guarded managed object grant no edit, delete or transfer the write guard refuses, `modifyAllRecords` included
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
The managed write clamp behind `/auth/me/permissions` and `ISecurityService.getEffectiveObjectPermissions` cleared `allowEdit`, `allowCreate` and `allowDelete` on an object in a guarded `managedBy` bucket (`better-auth`, `engine-owned`, `append-only`) that does not opt the verb in through `userActions`, but left two grants the write guard refuses:
11+
12+
- **`modifyAllRecords`**, which grants edit, delete and transfer on its own. A permission set naming such an object with `{ modifyAllRecords: true }` made `current_user.can(object, 'edit' | 'delete' | 'transfer')` answer `true` while every one of those writes was refused. Where the guard refuses `edit` or `delete`, it is now lowered to `viewAllRecords` (the read it implies, so read is unchanged), and each verb the object still opts in is kept as its plain bit: an object opting `edit` in (such as `sys_user`) keeps edit and transfer and loses delete; an object opting nothing in keeps read only. An object opting both `edit` and `delete` in keeps `modifyAllRecords`. The external write clamp lowers it through the same helper.
13+
- **`allowTransfer`**, which now follows `edit`: an owner change is an update, refused unless `edit` is opted in. This also corrects a super-user wildcard admin, who was answered `can(object, 'transfer')` `true` on every guarded object that does not opt `edit` in.
14+
15+
No write changes: the guard refused each of these before and still does. Only the served capability answer, and the console buttons that read it, now match it.

‎packages/core/src/security/effective-object-permissions.test.ts‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,73 @@ describe('[#30370] an object whose external write gate is closed grants no write
555555
});
556556
});
557557

558+
describe('[#30440] a guarded managed object grants no verb its write guard refuses, modifyAllRecords included', () => {
559+
const SCHEMAS: Record<string, any> = {
560+
// engine-owned, nothing opted in: the guard refuses every user-context write.
561+
sys_automation_run: { name: 'sys_automation_run', managedBy: 'engine-owned' },
562+
// better-auth with only `edit` opted in (the sys_user shape).
563+
sys_user: { name: 'sys_user', managedBy: 'better-auth', userActions: { edit: true } },
564+
// append-only with both row verbs opted in (object form for delete).
565+
sys_feed_note: { name: 'sys_feed_note', managedBy: 'append-only', userActions: { edit: true, delete: { enabled: true } } },
566+
// no guard covers it.
567+
crm_lead: { name: 'crm_lead' },
568+
};
569+
const source = { allSchemas: () => Object.values(SCHEMAS), schemaOf: (name: string) => SCHEMAS[name] };
570+
const ROW_VERBS = ['allowEdit', 'allowDelete', 'allowTransfer'] as const;
571+
const can = (entry: any) => Object.fromEntries(
572+
(['allowRead', 'allowCreate', ...ROW_VERBS] as const).map((verb) => [verb, objectPermissionGrants(entry, verb)]),
573+
);
574+
575+
it('an explicit { modifyAllRecords: true } on an object opting nothing in answers no edit, delete or transfer, and the same read', () => {
576+
const map: any = buildEffectiveObjectPermissions([{ objects: { sys_automation_run: { modifyAllRecords: true } } }], source);
577+
expect(can(map.sys_automation_run)).toEqual({ allowRead: true, allowCreate: false, allowEdit: false, allowDelete: false, allowTransfer: false });
578+
expect(map.sys_automation_run).toMatchObject({ modifyAllRecords: false, viewAllRecords: true });
579+
});
580+
581+
it('an object opting edit in keeps edit and transfer through it, and loses delete', () => {
582+
const map: any = buildEffectiveObjectPermissions([{ objects: { sys_user: { modifyAllRecords: true } } }], source);
583+
expect(can(map.sys_user)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: false, allowTransfer: true });
584+
expect(map.sys_user).toMatchObject({ modifyAllRecords: false, viewAllRecords: true, allowEdit: true, allowTransfer: true });
585+
});
586+
587+
it('an object opting edit and delete in keeps modifyAllRecords as granted', () => {
588+
const map: any = buildEffectiveObjectPermissions([{ objects: { sys_feed_note: { modifyAllRecords: true } } }], source);
589+
expect(map.sys_feed_note.modifyAllRecords).toBe(true);
590+
expect(map.sys_feed_note).not.toHaveProperty('viewAllRecords');
591+
expect(can(map.sys_feed_note)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: true, allowTransfer: true });
592+
});
593+
594+
it('a plain allowTransfer on an object not opting edit in answers no transfer; opting edit in keeps it', () => {
595+
const map: any = buildEffectiveObjectPermissions(
596+
[{ objects: { sys_automation_run: { allowRead: true, allowTransfer: true }, sys_user: { allowRead: true, allowTransfer: true } } }],
597+
source,
598+
);
599+
expect(objectPermissionGrants(map.sys_automation_run, 'allowTransfer')).toBe(false);
600+
expect(objectPermissionGrants(map.sys_automation_run, 'allowRead')).toBe(true);
601+
expect(objectPermissionGrants(map.sys_user, 'allowTransfer')).toBe(true);
602+
});
603+
604+
it('CONTROL: the same entry on an unguarded object keeps every verb modifyAllRecords grants', () => {
605+
const map: any = buildEffectiveObjectPermissions([{ objects: { crm_lead: { modifyAllRecords: true } } }], source);
606+
expect(map.crm_lead.modifyAllRecords).toBe(true);
607+
expect(can(map.crm_lead)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: true, allowTransfer: true });
608+
});
609+
610+
it('CONTROL: the super-user wildcard fold answers as before, transfer on the object opting nothing in aside', () => {
611+
const map: any = buildEffectiveObjectPermissions(
612+
[{ objects: { '*': { allowRead: true, viewAllRecords: true, modifyAllRecords: true } } }],
613+
source,
614+
);
615+
expect(can(map.crm_lead)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: true, allowTransfer: true });
616+
expect(can(map.sys_user)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: false, allowTransfer: true });
617+
expect(can(map.sys_feed_note)).toEqual({ allowRead: true, allowCreate: false, allowEdit: true, allowDelete: true, allowTransfer: true });
618+
// The fold copies the bits the wildcard grants, never modifyAllRecords itself.
619+
for (const name of Object.keys(SCHEMAS)) expect(map[name], name).not.toHaveProperty('modifyAllRecords');
620+
// The one answer that moves: the folded transfer bit, on the object whose guard refuses the update.
621+
expect(can(map.sys_automation_run)).toEqual({ allowRead: true, allowCreate: false, allowEdit: false, allowDelete: false, allowTransfer: false });
622+
});
623+
});
624+
558625
// ── [#25866 / ruling of record 6408558941] A field permission entry's row
559626
// condition (`when`): the ONE vote per verdict, and the row-blind merge behind
560627
// `/auth/me/permissions`' `fields` slot.

‎packages/core/src/security/effective-object-permissions.ts‎

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,18 @@ const GUARDED_WRITE_BUCKETS: ReadonlySet<string> = new Set(['better-auth', 'engi
239239
* objects are NOT clamped — no guard covers them, so their permission-set result
240240
* stands (an admin CAN write them via the data API, and the hint must not
241241
* under-report that).
242+
*
243+
* [#30440] Every verb the guard refuses is refused whatever grants it:
244+
* - `allowTransfer` follows `edit` — an owner change is an update, which the
245+
* guard refuses unless `edit` is opted in; the super-user wildcard fold
246+
* copies the transfer bit onto every entry it covers;
247+
* - `modifyAllRecords` grants edit, delete and transfer on its own (the
248+
* spec's `objectPermissionGrants`), so no `allow*: false` beside it takes
249+
* any of them away. Where the guard refuses `edit` or `delete` it is lowered
250+
* by {@link lowerModifyAllRecords}: to `viewAllRecords`, the read it
251+
* implies, plus the plain bit of each verb the object still opts in. Where
252+
* `edit` and `delete` are both opted in it grants nothing the guard
253+
* refuses, and stays.
242254
*/
243255
export function clampManagedObjectWrites(
244256
objects: Record<string, any>,
@@ -249,15 +261,42 @@ export function clampManagedObjectWrites(
249261
const schema = schemaOf(obj);
250262
if (!schema?.managedBy || !GUARDED_WRITE_BUCKETS.has(schema.managedBy)) continue;
251263
const ua = schema.userActions ?? {};
252-
if (!isWriteOptedIn(ua.edit)) acc.allowEdit = false;
264+
const edit = isWriteOptedIn(ua.edit);
265+
const del = isWriteOptedIn(ua.delete);
266+
if (!edit) acc.allowEdit = false;
253267
// `create` reads through the same opt-in helper as edit/delete since
254268
// #7692 widened it to the object form — a bare `ua.create !== true`
255269
// would clamp away a legitimate `{ enabled: true, visibleWhen: … }`.
256270
if (!isWriteOptedIn(ua.create)) acc.allowCreate = false;
257-
if (!isWriteOptedIn(ua.delete)) acc.allowDelete = false;
271+
if (!del) acc.allowDelete = false;
272+
if (!edit) acc.allowTransfer = false;
273+
lowerModifyAllRecords(acc, { allowEdit: edit, allowDelete: del, allowTransfer: edit });
258274
}
259275
}
260276

277+
/**
278+
* Lower an entry's `modifyAllRecords` where a server-side layer refuses a verb
279+
* it grants. The spec's `objectPermissionGrants` answers edit, delete and
280+
* transfer `true` on `modifyAllRecords` alone, so no `allow*: false` beside it
281+
* takes any of them away: the bit itself has to go. It becomes
282+
* `viewAllRecords` — the read it implies, so the entry keeps exactly the read
283+
* it had — and each verb `kept` names is carried over as its plain bit, so a
284+
* verb the layer still admits is not lost with it. An entry the layer admits
285+
* every one of those verbs on is left as it is.
286+
*/
287+
function lowerModifyAllRecords(
288+
acc: Record<string, any>,
289+
kept: { allowEdit: boolean; allowDelete: boolean; allowTransfer: boolean },
290+
): void {
291+
if (acc.modifyAllRecords !== true) return;
292+
if (kept.allowEdit && kept.allowDelete && kept.allowTransfer) return;
293+
acc.modifyAllRecords = false;
294+
acc.viewAllRecords = true;
295+
if (kept.allowEdit) acc.allowEdit = true;
296+
if (kept.allowDelete) acc.allowDelete = true;
297+
if (kept.allowTransfer) acc.allowTransfer = true;
298+
}
299+
261300
/** The API-exposure-relevant slice of a registered object schema. */
262301
export interface ApiExposureSchemaLike {
263302
name?: string;
@@ -551,7 +590,7 @@ const EXTERNAL_WRITE_GATED_OPERATIONS: ReadonlySet<ApiOperation> = new Set<ApiOp
551590
* answers edit, delete and transfer `true` on it alone, so an entry keeping it
552591
* would still answer `current_user.can(object, 'edit')` `true`. It is lowered
553592
* to `viewAllRecords`, the read half it implies, so the entry keeps exactly
554-
* the read it had.
593+
* the read it had ({@link lowerModifyAllRecords}, keeping no verb).
555594
*
556595
* An object the map does not mention already grants nothing, and is left out.
557596
*/
@@ -563,10 +602,7 @@ function clampExternalReadOnlyWrites(objects: Record<string, any>, forbidden: Re
563602
acc.allowEdit = false;
564603
acc.allowDelete = false;
565604
acc.allowTransfer = false;
566-
if (acc.modifyAllRecords === true) {
567-
acc.modifyAllRecords = false;
568-
acc.viewAllRecords = true;
569-
}
605+
lowerModifyAllRecords(acc, { allowEdit: false, allowDelete: false, allowTransfer: false });
570606
}
571607
}
572608

‎packages/plugins/plugin-security/src/get-effective-object-permissions.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ describe('[#18783] the engine is handed the same producer', () => {
354354
* the create / edit / delete verbs may read NARROWER than the evaluator: that
355355
* is the managed-write clamp, the engine write guard the permission sets do not
356356
* model. There the pin holds the refuse direction only — the map never grants
357-
* what the evaluator refuses.
357+
* what the evaluator refuses. [#30440] `transfer` is one of them: an owner
358+
* change is an update, which the guard refuses unless the object opts `edit` in.
358359
*
359360
* [#20134] Subjects whose sets carry a SUPER-USER wildcard are held by the same
360361
* table, one row per shape: the shipped platform admin and walled org admin, a
@@ -473,6 +474,15 @@ describe('[#20083] parity: can() over the member\'s map answers what checkObject
473474
shipped('admin_full_access'), shipped('organization_admin'), shipped('member_default'),
474475
],
475476
// [#20135] The export slot's own shapes.
477+
// [#30440] An explicit modify-all entry on guarded managed objects: one opting
478+
// `edit` in (sys_user), one opting nothing in (sys_member), one private (sys_secret).
479+
'[#30440] explicit modifyAllRecords entries on guarded managed objects': [
480+
authored('managed_modify_all', {
481+
[SysUser.name]: { modifyAllRecords: true },
482+
[SysMember.name]: { modifyAllRecords: true },
483+
[SysSecret.name]: { modifyAllRecords: true },
484+
}),
485+
],
476486
'platform admin beside a plain export-only wildcard': [shipped('admin_full_access'), authored('exporter', { '*': { allowExport: true } })],
477487
'one set: an exporting wildcard AND an explicit entry without the grant': [
478488
authored('same_export', { '*': { allowRead: true, allowExport: true }, crm_lead: { allowRead: true } }),
@@ -484,7 +494,7 @@ describe('[#20083] parity: can() over the member\'s map answers what checkObject
484494
allowTransfer: 'transfer', allowExport: 'export',
485495
};
486496
const GUARDED = new Set(['better-auth', 'engine-owned', 'append-only']);
487-
const CLAMPED = new Set(['allowCreate', 'allowEdit', 'allowDelete']);
497+
const CLAMPED = new Set(['allowCreate', 'allowEdit', 'allowDelete', 'allowTransfer']);
488498
const USER = { id: 'u_parity', positions: [] as string[] };
489499
const evaluator = new PermissionEvaluator();
490500

0 commit comments

Comments
 (0)