Skip to content

[2.0] Fixes #35636: Show the view-permission placeholder when ViewBasic is denied but ViewAll allowed (#38769) - #38837

Merged
harsh-vador merged 1 commit into
2.0from
backport/2.0/pr-38769
Nov 27, 2026
Merged

harsh-vador merged 1 commit into
2.0from
backport/2.0/pr-38769

Conversation

@harsh-vador

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35636

Backport of #38769 to 2.0, ported by hand. The bot's cherry-pick conflicted because 2.0 predates getDerivedPermissionFlags / useEntityPermissions.

  • The bug is on 2.0 too. Topic, Metric, Directory, File, Worksheet and Spreadsheet pages run the entity fetch only when 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:
    • Topic and Metric show the loading skeleton forever.
    • The other pages render an empty details view.
  • Fix. The placeholder now uses the same check as the fetch:
    • Topic and Metric reuse their existing canViewTopic / canViewMetric.
    • The other four call getPrioritizedViewPermission(..., ViewBasic) directly.
  • Differences from main:

Type of change:

  • Bug fix

Tests:

  • Each of TopicDetailsPage, DirectoryDetailsPage, FileDetailsPage, WorksheetDetailsPage and SpreadsheetDetailsPage tests now covers both {ViewAll:false, ViewBasic:false} and {ViewAll:true, ViewBasic:false}. Topic also asserts that getTopicByFqn is never called.
  • Jest on 2.0's own dependencies, 5 suites:
    • with the fix: Tests: 99 passed, 99 total;
    • 2.0 baseline before the change: 93 passed;
    • with the source fix reverted: the {ViewAll:true, ViewBasic:false} cases fail.
  • ESLint and Prettier are clean on the changed files. tsc reports no errors on the changed lines.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests and listed them above.

🤖 Generated with Claude Code

…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)
@harsh-vador
harsh-vador requested a review from a team as a code owner November 26, 2026 10:52
@harsh-vador
harsh-vador requested review from sweta1308 and removed request for a team November 26, 2026 10:52
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Nov 26, 2026
@gitar-bot

gitar-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Updating 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador merged commit 486c5aa into 2.0 Nov 27, 2026
50 of 56 checks passed
@harsh-vador
harsh-vador deleted the backport/2.0/pr-38769 branch November 27, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants