Repository navigation
fix(app-shell): a member refused the Setup app gets the access-denied screen on the Setup create form too - #29237
Merged
Conversation
…dict A caller the Setup app refuses who opens /apps/setup/OBJECT/new now gets the access-denied screen the object list beside it draws, instead of the create form under the default app's shell. Record routes are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU9jKHFCJuQuuKRtpX
Contributor
Author
|
domain:ui#2 · zhuangjianguo · session_01QsR2jRFuJz9QBZqPVHYVhJ 维护者速读
席位意见: 改动最小:判定集合加一条新建表单路径,函数改名以名副其实;记录页不动。新用例在 main 上红 2 个、修复后全绿,另有管理员对照用例。无公开面变化, 席位核对 — 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 #29102
Clause-②: no
Metadata-protocol: none
维护者速读
/apps/setup/sys_user/new这类别名地址)时,现在看到与同一对象列表页相同的「无权访问此应用」页面;规范地址/apps/com.objectstack.setup/OBJECT/new也是同一页面。/apps/setup/OBJECT/record/ID按 objectui#12706 的未决决定保持原样。回滚即还原本 PR。ui/packages/app-shell/src/console/AppContent.tsx(OBJECT_COLLECTION_ROUTE_PATHS新增的:objectName/new一行)。pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.setupObjectListVerdict-28988.test.tsx,预期 16 个用例全绿。What changes
setupalias now includes the create form,:objectName/new, beside the list routes console: a member refused the Setup app still gets /apps/setup/OBJECT routes rendered inside another app's shell — the alias spelling skips the app verdict #27507 added #28988 added (:objectName,:objectName/view/:viewId,:objectName/data). Adeniedverdict drawsapp-access-deniedand the form never mounts.OBJECT_LIST_ROUTE_PATHSbecomesOBJECT_COLLECTION_ROUTE_PATHS,isObjectListAppRoutebecomesisObjectCollectionAppRoute, andisSetupObjectListRoutebecomesisSetupObjectCollectionRoute. Matching is unchanged: by route rank againstAPP_ROUTE_METADATA_READSplus the host's routes, so a static or host route under the Setup segment is never read as one.OBJECT/record/ID, its/editand/page/NAME, and theOBJECT/IDshorthand) stay outside the gate, as objectui#12706 leaves them. No metadata key or option is added.Why
/apps/setupis a pseudo-route, so an unmatchedsetupsegment falls back to the launcher's default app unlessappSurfaceAwaitsVerdictnames the sub-route. After #28988 it named the list routes only, so a refused member on/apps/setup/OBJECT/newgot the create form inside the default app's chrome. The create form names no record, so no approvals-inbox link lands on it. The canonical/apps/com.objectstack.setup/OBJECT/newis an ordinary unmatched app and already drew the refusal; it is pinned here so both spellings stay the same.Tests
AppContent.setupObjectListVerdict-28988.test.tsxgains a stubbedRecordFormPage(counted like the other page stubs) and four cases:app-access-denied, noConsoleLayoutand no page mounted, on/apps/setup/sys_user/new,/apps/setup/showcase_task/newand/apps/com.objectstack.setup/sys_user/new. The one by-name probe is the app the URL names, and the URL is left as typed.mode="create") under Setup, unprobed./apps/setup/sys_user/record/usr_000001) passes unchanged, as do the objectui#12706 file's inbox controls.main: withAppContent.tsxatc44c8ac4and the new tests unchanged, the two alias cases fail (Tests 2 failed, 14 passed). The package-id case and the controls pass there.Acceptance notes
Verification
Local runs
Head
83289601(fixead56761plus a merge ofmainat49aba82b; basec44c8ac4). The suites below marked "merged head" ran on83289601; the rest ran onead56761, and the merge brought nothing intoui/packages/app-shell/src/console/AppContent.tsxor its tests.turbo run build --filter='@object-ui/app-shell^...'plus formula, sdui-parser, lint and client, 64 of 64 tasks.main(AppContent.tsxatc44c8ac4, restored to the HEAD blob afterwards,git diff HEADempty): Tests 2 failed, 14 passed.packages/app-shelltest file that namesAppContent(git grep -l, 93 files), onead56761and again on the merged head after rebuilding the closure: Test Files 93 passed, Tests 777 passed, both times. A narrowing of app-shell's suite; CI's Test UI shards run the rest.turbo run type-check --filter=@object-ui/app-shell(its script also runstsc -p tsconfig.test.json, so the test is compiled): 65 of 65 tasks.node scripts/pm/dispatch-gates.mjs --commands: 34 derived commands, each exit 0, among themcheck-sdui-manifest.mjs,check-changeset-no-major.mjs --base origin/main,check:type-check-debt,check:published-files,check:nul-bytesandpnpm --dir ui exec vitest run scripts/(Test Files 169 passed, 2 skipped; Tests 4900 passed, 2 skipped).--ranreconciliation: 34 derived, 34 run, 0 NOT-MEASURED. The derivation on the merged head is identical, and the PR-body and changeset gates were run again there against this body.pnpm check:new-line-citations: 0 new citations.Human Minimum
packages/specholds no runtime logic. (packages/specnot touched.)pnpm lintis CI's run.main, one pull request.packages/spectouched: not applicable.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jU9jKHFCJuQuuKRtpX
Generated by Claude Code