Repository navigation
[2.1] Fixes #38800: Gate article header actions on the article's own permission - #38819
Conversation
…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)
❌ 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 🔴 High riskUsing 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. 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 #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
knowledgePagepermission. WithisOwner()-conditioned rules that comes backconditionalAllow, 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.ContextCenterArticlesPagenow passes the open article's entity-level permission (useEntityPermissions(KNOWLEDGE_PAGE, fqn)) toArticleDetailHeader; it shares the cached query the article body already makes, so there's no extra request.ArticleDetailHeaderreadscanDeletefrom the derived flags instead of the rawDeletekey. Same fix as #38676 (memories).Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
src/pages/ContextCenterPage/ContextCenterArticlesPage/ContextCenterArticlesPage.test.tsx(2 tests; both fail with the fix reverted).npx jest ContextCenterArticlesPage ArticleDetailHeader KnowledgePageDetailComponent: 3 suites, 43/43 passed.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
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(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.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.