Repository navigation
fix(app-shell): a New similar copy in a base's .custom pair lists and counts its grants on the base's objects - #29718
Merged
Conversation
…n the base's objects A New similar copy of a read-only base's permission set lands in the base's paired .custom package. The package door scoped its matrix to the objects the pair declares, which are none of the base's, so the copy read 0 objects granted though the server holds its grants. A pair's set is now scoped to the base's objects as well as its own (ADR-0146 D3), and the Studio note names the base. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVCDukgxJSJ3tEvg5W
…osition; add the changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVCDukgxJSJ3tEvg5W
Contributor
Author
|
domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ 维护者速读
席位意见: 复测 main 上为 0/0,修复后 8 个对象 · 3 个字段,与服务端读到的一致;编辑基础包对象的授权只落到定制包草稿。用的是规格自带的 席位核对 — ACCEPT ·
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steedos · project thread
Fixes #29674
Clause-②: no
Metadata-protocol: none
维护者速读
.custom)中的权限集现在会列出并统计它在基础包对象上的授权;「新建类似」复制出来的权限集不再显示「已授权 0 个对象」。ui/packages/app-shell/src/views/metadata-admin/permission-slice.ts(permissionObjectScopePackages)、PermissionMatrixEditor.tsx的对象列表读取、StudioDesignSurface.tsx权限页的范围提示。pnpm dev:showcase后对showcase_contributor调用 clone 接口,再打开/_console/studio/com.example.showcase/access?surface=permission%3A新名字,应看到「已授权 8 个对象 · 3 个字段覆盖」,提示条显示「本包及 ObjectStack Showcase 的对象 · 保存为草稿」。What changes
permissionObjectScopePackages(packageId)(new,permission-slice.ts) answers[pair, base]for a pairedBASE.custompackage, by the spec's pairing rule (customizationBasePackageIdfrom@objectstack/spec/kernel), and[packageId]for every other package. ADR-0146 D3: the pair receives the permission sets for its base, and it declares none of the base's objects.PermissionMatrixEditor.tsx) lists the draft-overlaid objects of each scope package and keeps one row per object name. The slice, the counts and the save merge all read that list, so a pair's set now shows, counts and edits its grants on the base's objects. The save is unchanged: it writes the set's draft at its own package (the pair), and rows outside the scope are re-merged from a fresh read as before (ADR-0086 P0).packageIdwith the spec's pairing rule. No new prop and no new read.StudioDesignSurface.tsx, the access arm only): on an open set the pair adds, the chip reads "This package's and BASE_LABEL's objects · saved as draft" (zh 「本包及 BASE_LABEL 的对象 · 保存为草稿」), with a title that says why. Every other note is unchanged. Two new@object-ui/i18nstudio keys,engine.studio.access.bannerPairandengine.studio.access.bannerTitlePair, in both locales the studio namespace has (en,zh).Tests
StudioDesignSurface.accessPairCopy-29674.test.tsx(new): the realStudioDesignSurface,AccessPillarandPermissionMatrixEditPageover the real metadata client and a fetch stub (base read-only, its pair writable). A copy in the pair that grants 8 base objects and 3 field overrides lists the 8 objects, draws their grants and reads "8 objects granted · 3 field overrides"; its note names the base; an edit to a base object's grant PUTs only/meta/permission/COPY?package=PAIRwith every grant kept, and no write names the base. CONTROL: the base's own set lists the base's objects and reads no pair object list.PermissionMatrixEditor.pairScope-29674.test.tsx(new): the helper (a pair, a base, an ordinary package, a pair of a pair); a pair's set lists the pair's and the base's objects once each and saves a base-object grant into the pair's draft. CONTROL: an ordinary package's set lists only its own objects, and its save keeps another package's object and field rows byte-identical.scripts/ablation-replace.mjswith an on-disk proof and a proven restore to HEAD:[packageId]again (scope to the pair's own objects): 6 of 9 cases red, the 3 controls green;Test runs (fix at cbaf5f9 / 82fbfd0; re-run at the merged head 607c05c)
PermissionMatrixEditor*,permission-slice*, Studio access suites,oneSurface-28572,zh-base-term, plus all ofpackages/i18n): Test Files 154 passed, Tests 1837 passed, 13 skipped.pnpm --filter @object-ui/app-shell run type-checkandpnpm --filter @object-ui/i18n run type-check: exit 0.pnpm --dir ui run check:phantom-deps,check:spec-symbols,check:i18n-keys,check:i18n-drift: exit 0.Acceptance notes
.catcharound both reads); no new degradation.Verification
Live on
pnpm dev:showcase --fresh(admin), the card's recipe:POST /api/v1/security/permission-sets/showcase_contributor/clonewith{name: qa_contrib_29674, label}answered 200 incom.example.showcase.custom;GET /api/v1/meta/permission/qa_contrib_29674?package=com.example.showcase.customread 8 objects and 3 fields. The Console ran from source (Vite) against that server.showcase_invoicesent one PUT,/api/v1/meta/permission/qa_contrib_29674?mode=draft&package=com.example.showcase.custom&surface=studio; the pair's draft read back 8 objects, 3 fields,showcase_invoice.allowDelete: true; the base setshowcase_contributorstill readsallowDelete: false, and the base holds no drafts.showcase_contributorreads 8 objects · 3 field overrides, read-only, as before.Screenshots (project files
issue-29674/shots/):before-qa_contrib_29674-zh.png,after-qa_contrib_29674-zh.png,after-qa_contrib_29674-zh-edited.png,after-qa_contrib_29674-en.png,control-showcase_contributor-zh.png.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 derived families, all run locally, all exit 0;--ranreconciliation: "35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED (a DERIVED zero)".check:query-options-erasurehit a 300 s per-command cap in the loop (exit 124) and passed rerun alone.--tier: no path-derived mandate. Changed lines 511, under the 3000 threshold.Generated by Claude Code