Repository navigation
[2.0] Fixes #35636: Show the view-permission placeholder when ViewBasic is denied but ViewAll allowed (#38769) - #38837
Conversation
…denied but ViewAll allowed (#38769) Backport of #38769 to 2.0, ported by hand. Topic, Metric, Directory, File, Worksheet and Spreadsheet pages gated the entity fetch on getPrioritizedViewPermission(ViewBasic) but the permission placeholder on the raw ViewBasic || ViewAll OR. With an explicit ViewBasic deny next to a ViewAll allow the fetch never ran and the placeholder never showed. Gate the placeholder on the same check. (cherry picked from commit b15000c)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskUpdating six detail pages to use the existing ViewBasic check changes denied-user rendering, preventing stuck loaders or empty details without changing data access. Fixes the view-permission placeholder on Topic, Metric, Directory, File, Worksheet and Spreadsheet details pages so it uses the same ViewBasic check as the entity fetch, preventing an infinite loading skeleton or empty details view when ViewBasic is denied and ViewAll is allowed. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #35636
Backport of #38769 to
2.0, ported by hand. The bot's cherry-pick conflicted because2.0predatesgetDerivedPermissionFlags/useEntityPermissions.getPrioritizedViewPermission(permissions, ViewBasic)passes. But they show the permission placeholder only when!ViewAll && !ViewBasic. A user with ViewBasic explicitly denied and ViewAll allowed fails the first check and passes the second. The result:canViewTopic/canViewMetric.getPrioritizedViewPermission(..., ViewBasic)directly.MetricDetailsPage.test.tsx, so Metric gets the one-line fix without a test.getPrioritizedViewPermissionto always returntrue, so they could not exercise the bug. They now use the real helper. This is the same function the pages call, with no other imports.Type of change:
Tests:
TopicDetailsPage,DirectoryDetailsPage,FileDetailsPage,WorksheetDetailsPageandSpreadsheetDetailsPagetests now covers both{ViewAll:false, ViewBasic:false}and{ViewAll:true, ViewBasic:false}. Topic also asserts thatgetTopicByFqnis never called.Tests: 99 passed, 99 total;93 passed;{ViewAll:true, ViewBasic:false}cases fail.tscreports no errors on the changed lines.Checklist:
Fixes #<issue-number>above.🤖 Generated with Claude Code