Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): gate the runtime report/dashboard editors behind admin - #1508
Merged
Conversation
Editing a report or dashboard mutates the SHARED definition (single sys_report/sys_dashboard record), but the edit buttons were shown to every user — any viewer could mutate a shared report/dashboard. Gate the edit button and its config panel behind isAdmin, matching ObjectView's existing view-config gate. First step of ADR-0034 (runtime edits = admin quick-edit of the shared definition).
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
June 6, 2026 08:23
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 6, 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 freeto 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.
背景
ADR-0034 调研中核实到一个独立的真实缺陷:运行时报表/仪表盘的编辑按钮无任何权限门控——而它们写的是共享记录(
sys_report/sys_dashboard单条),所以任何普通用户点"编辑"保存,就改了所有人的报表/仪表盘。视图编辑早已是 isAdmin 门控,这两处却没有。改动
给
ReportView与DashboardView的编辑入口补上管理员门控(对齐ObjectView):useAuth().user?.role === 'admin'计算isAdmin。{isAdmin && <button .../>})。open加&& isAdmin防御。这是 ADR-0034 v1 的第一步(运行时编辑 = 管理员对共享定义的快速编辑),小、安全、独立可上线,不依赖后端。
验证
pnpm turbo run build --filter=@object-ui/app-shell:27/27 通过。app-shell/src/views测试:179 全过。https://claude.ai/code/session_01SZW3fVCCbijEibXtEH3ZGL
Generated by Claude Code