Repository navigation
fix(console): offer view management on manage_metadata, not isAdmin alone - #36782
Merged
Merged
Conversation
…lone Manage views, the view settings panel, Create View (list page and the data page's Save as view) and a saved shared view's rename and save in place all lead to a view metadata write the server refuses without manage_metadata. They now read mayManageViews(isAdmin, useCanAuthorMetadata()), the answer the Shared choice already reads. Claude-Session: https://claude.ai/code/session_01JQwxbYXZHUaaZK86HquGRP Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbYXZHUaaZK86HquGRP Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读组织管理员如果没有「管理元数据」权限,列表上就不再出现「管理视图」「视图设置」「新建视图」「另存为视图」「重命名」「保存到此视图」这些入口。以前点了会报 403,现在直接不显示。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
This was referenced Nov 23, 2026
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 Warren · project thread
Fixes #36448
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
One answer gates every entry on a list page that leads to a
viewmetadata write:mayManageViews(isAdmin, useCanAuthorMetadata())— an administrator whose session holdsmanage_metadata, the capabilityPUT/DELETE /meta/view/NAMEasks (metaWriteCapabilityVerdict). It is the predicate #36398 introduced for the Shared choice (mayShareViews), renamed because it now gates more than sharing.ObjectViewcomputescanManageViewsonce and reads it for: theManageViewsDialogmount, theViewConfigPanelopen state and wrapper, theCreateViewDialogopen state, the title switcher's Add view / Manage views entries (useObjectViewTitleSwitcherpropisAdminbecomescanManageViews), and the plugin view'sallowCreateViewandviewActions(settings, share, delete) (useObjectViewPluginSchema, same rename).ObjectDataPage's Save as view (button, folded menu item and itsCreateViewDialog) — a fourth Create View door, writing/meta/viewthroughcreateRuntimeMetadata— reads the same predicate.canSaveToSharedView) both write/meta/viewthroughupdateViewand were offered onisAdminalone; they readcanManageViewstoo.isAdminalone still gates what only reads (the metadata inspector panel, the package-list reads behind the panel's read-only state).A reader's own views (
sys_personal_view) are untouched: the in-place Add view still offers My view to everyone who may create one.Tests
ObjectView.viewManagementGate-36448.test.tsx: the realObjectViewunder the router; an organization administrator withoutmanage_metadatagets no Manage views entry (and no dialog); one with it opens Manage views and Create View from it (control); a member gets neither. The plugin schema: without the capabilityallowCreateViewis false andviewActionsempty; with it, both offered (control).ObjectDataPage.saveAsViewRefusal-11578.test.tsx: new top-level describe in the existing harness — Save as view (button, menu item, dialog) absent without the capability, present with it (control); the existing cases now set the capability explicitly.objectViewViewSharing.test.tsxandobjectViewRecordNavigation.phonePush-29074.test.tsxfollow the rename.Acceptance notes
Verification
Two-minute check: sign in as an organization administrator who lacks
manage_metadata, open any object list — the view switcher shows no Manage views and the data page no Save as view; as a metadata administrator both are there.Riskiest hunks to read first:
ObjectView.tsx(thecanManageViewsline and the three JSX gates),objectViewPluginSchema.ts(allowCreateView/viewActions),ObjectDataPage.tsx(canSaveAsView).Readings at head 10d4f44
pnpm --dir ui exec vitest runonObjectView.viewManagementGate-36448.test.tsx,ObjectDataPage.saveAsViewRefusal-11578.test.tsx,objectViewViewSharing.test.tsx,objectViewRecordNavigation.phonePush-29074.test.tsx— Test Files 4 passed (4), Tests 26 passed (26) (lock VERDICT command-exit 0), afterpnpm --filter '@object-ui/app-shell^...' build(exit 0).e0f0e9f7with the new tests kept — 4 of 10 cases RED: the three without-capability cases (Manage views offered, Save as view offered, plugin Create View and view actions offered) as predicted, plus the plugin-schema control, which goes red because the old hook takesisAdmin, notcanManageViews(the rename, not the gate). Restored withgit checkout HEAD;git diff HEADempty afterwards.pnpm --filter @object-ui/app-shell run type-check— lock VERDICT command-exit 0.dispatch-gates.mjs --commandsderived families, all run locally, all exit 0;--ranreconciliation: 38 of 38 accounted for:node scripts/check-closing-keyword-parity.mjsnode scripts/check-closing-keyword-parity.mjs --self-testnode scripts/check-comment-mask-corpus.mjsnode scripts/check-sdui-manifest.mjsnode scripts/check-sdui-manifest.mjs --self-testpnpm --dir ui exec vitest run scripts/pnpm --filter @objectstack/spec run check:duration-unit-keyspnpm check:adr-anchorspnpm check:cross-package-test-inputspnpm check:dispatcher-error-vocabularypnpm check:driver-memory-censuspnpm check:engine-double-contractpnpm check:gitlink-declaredpnpm check:nul-bytespnpm check:published-filespnpm check:query-options-erasurepnpm check:refd-timer-probepnpm check:registry-log-declaredpnpm check:rest-log-spy-declaredpnpm check:skill-identifier-livenesspnpm check:test-source-aliaspnpm check:tier-file-adoptionpnpm check:type-check-coveragepnpm check:type-check-debtpnpm check:undeclared-dep-importspnpm check:watch-hint-literalpnpm check:where-matchernode scripts/check-adr-0087-registration.mjs --base origin/mainnode scripts/check-adr-0087-registration.mjs --self-testnode scripts/check-changeset-no-major.mjs --base origin/mainnode scripts/check-empty-changeset.mjs --base origin/mainnode scripts/check-empty-changeset.mjs --self-testnode scripts/ci/snapshot-next.mjs --self-testnode scripts/pm/check-governed-queue-guard.mjs --self-testnode scripts/pm/release-rehearsal-clone.mjs --self-testnode scripts/release-pending-publish.mjs --self-testpnpm check:changeset-gate-self-testspnpm check:closed-ceremony-textpr-state.mjs: mergeable_state clean).Generated by Claude Code