Repository navigation
Let every Duly set read business units, so a unit shows its name - #183
Conversation
Members, managers and Duly admins got 403 on sys_business_unit, so the unit lookup on a task or duty rendered as a raw id, and a duly_admin who is not a platform admin could not Import samples/duties.csv (units resolve by name under the importer's read: 0/19). Grant read only, in MEMBER_OBJECTS, inherited by manager and admin. No write bit, no scope key and no field map: a name-only FLS mask also binds every admin who co-holds a Duly set and blanks Setup > Business Units (objectstack#29106). The note names what the read discloses, external_ref included. security.test.ts names the one platform read as the exception to the duly-namespace invariants; business-unit-read.test.ts drives it as real member, manager and admin holders (list, by id, by name, expanded lookup, writes refused, no fields entry on the object). Fixes #180 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba8DtH3fgAAexeLs8H
|
Browser pass on head e6c77d7: fresh
After the run the admin re-read all 6 units in each locale: none had changed. Generated by Claude Code |
席位核对ACCEPT — PR #183 at head
Generated by Claude Code |
LandedSeat landing at 2026-11-02T07:42Z (duly lane seat, session
State: #180 is closed Generated by Claude Code |
Requested by Warren · project thread
Fixes #180
What was wrong (measured on main 358c2ca, 18.2.0, live
pnpm demo)duly_member,duly_managerandduly_adminall got 403 onsys_business_unit.?expand=business_unitsilently returned the raw id. A member's own task and duty pages showedBUSINESS UNIT ⓘ Pda7prUARyl9pj4e.duly_adminwho is not a platform admin importedsamples/duties.csvwith 0/19 rows:Business unit: no record matches "Northgate Quality". The Import resolves the unit by name under the importer's own read.The change
src/security/permission-sets.ts:sys_business_unit: { allowRead: true }inMEMBER_OBJECTS. Manager and admin inherit it through the existing spread. There is no write bit, no scope key and nofieldsmap. The note says what the read discloses: every unit, every column,external_refincluded, read only. It also says why there is no name-only mask (fix(plugin-security): an app permission set's readable:false on a sys_* field also masks platform admins who hold that set objectstack#29106): FLSreadable:falsealso binds every admin who holds a Duly set. Measured: Setup → Business Units lost Kind, Head and Active, and the org chart went flat.test/security.test.ts: the "five duly objects" and "nothing outside the duly namespace" invariants each get one named exception,PLATFORM_READS. The grant is pinned exactly as parsed: read only, every other bit false.test/business-unit-read.test.ts(new) runs with real holders (buildContextForUser+ SecurityPlugin + SharingServicePlugin): a member, a member + manager, and a member + duly_admin. For each it checks:sys_business_unit.Negative control: with the grant reverted, 13/26 fail (every read). The refusals still pass.
docs/deployment/security.md: one row in the model table.Step 0 report with the prototype measurements: project file
duly-180-unit-name/step0.md.Gates
pnpm validate✓ ·pnpm typecheck✓ ·pnpm test46 files / 1316 tests ✓ ·pnpm build✓Browser pass in en-US and zh-CN will follow in a comment.
Generated by Claude Code