Skip to content

[2.1] Fixes #38800: Gate article header actions on the article's own permission - #38819

Merged
Rohit0301 merged 2 commits into
2.1from
Rohit0301/backport-38800-2.1
Nov 26, 2026
Merged

Rohit0301 merged 2 commits into
2.1from
Rohit0301/backport-38800-2.1

Conversation

@Rohit0301

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38800

Backport of #38818 to 2.1 (clean cherry-pick).

The Context Center article header gated owner edit, domain edit and the delete (manage) menu on the resource-level knowledgePage permission. With isOwner()-conditioned rules that comes back conditionalAllow, which the UI treats as denied, so an article's owner could edit the body but not its owners, domain or delete it — even though the entity-level permission and the API allow it. ContextCenterArticlesPage now passes the open article's entity-level permission (useEntityPermissions(KNOWLEDGE_PAGE, fqn)) to ArticleDetailHeader; it shares the cached query the article body already makes, so there's no extra request. ArticleDetailHeader reads canDelete from the derived flags instead of the raw Delete key. Same fix as #38676 (memories).

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Resource-level permission denies owner edit/delete, entity-level allows → header shows owner edit and the manage menu.
  • Resource-level allows, entity-level denies → header hides them.

Unit tests

  • Added src/pages/ContextCenterPage/ContextCenterArticlesPage/ContextCenterArticlesPage.test.tsx (2 tests; both fail with the fix reverted).
  • Ran npx jest ContextCenterArticlesPage ArticleDetailHeader KnowledgePageDetailComponent: 3 suites, 43/43 passed.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not added and not run locally. The Jest test mocks the entity-permission hook, so the server-side isOwner() evaluation is covered only by the existing backend behaviour described in the issue.

Manual testing performed

Not run against a live stack.

UI screen recording:

Not applicable — standalone bug fix (permission gating), not a UI feature.

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: N/A.

  • For a UI feature or feature task: N/A — bug fix.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

    • Reviewed c98fa0acd53: no 🔴. Follow-ups noted, out of scope: the left-hand hierarchy and quick-link edit modal still use the resource-level permission (as the issue proposes); entity permission isn't refreshed after an owner changes owners (pre-existing in the article body).
  • Decision check: no durable decision.

  • I have added a test that covers the exact scenario we are fixing.

…sion

The Context Center article header gated owner edit, domain edit and delete
on the resource-level knowledgePage permission, which leaves isOwner()-style
conditions unresolved (conditionalAllow) and so hid the actions from owners.
Pass the open article's entity-level permission instead; the resource-level
permission stays for the list, Create and the hierarchy.

(cherry picked from commit c98fa0a)
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 26, 2026 09:34
@Rohit0301
Rohit0301 requested review from harsh-vador and removed request for a team November 26, 2026 09:34
@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.

@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Using entity-level permissions to show article edit and delete controls changes authorization gating; a permission mismatch could expose management actions to unintended users.

Fixes the Context Center article header so owner edit, domain edit and delete actions are gated on the article's entity-level permission instead of the resource-level knowledgePage permission, which returned conditionalAllow for owners. ContextCenterArticlesPage passes the entity permission from the cached query to ArticleDetailHeader, and canDelete is read from the derived flags. 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

@Rohit0301
Rohit0301 merged commit 71f59cf into 2.1 Nov 26, 2026
46 of 47 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/backport-38800-2.1 branch November 26, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants