Skip to content

Fixes #38345: gate Profile custom-properties delete on EditAll not Delete - #38382

Merged
Rohit0301 merged 1 commit into
mainfrom
detail/bug-fix/fixes-38345-gate-profile-custom-properties-delete-02374a
Nov 23, 2026
Merged

Rohit0301 merged 1 commit into
mainfrom
detail/bug-fix/fixes-38345-gate-profile-custom-properties-delete-02374a

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #38345

I worked on the Profile → Custom Properties panel's delete-button permission gate, because it was gating on the wrong operation and breaking custom-property deletion for asymmetrically-permissioned users on type.

The delete button in CustomPropertiesDetailPage was gated on the raw Delete operation, but deleting a custom property is a JSON Patch remove on PATCH /metadata/types/{id}, which the backend authorizes as EditAll (no narrower field→operation mapping is registered for customProperties in ResourceRegistry; verified by JsonPatchUtilsTest). So:

  • A user with only Delete on type saw the delete action but it always failed with 403 operations [EDIT_ALL] not allowed, leaving the confirm popover stuck open.
  • A user with EditAll but not Delete had a valid action hidden from them.

The classic Settings custom-properties page (CustomPropertiesPageV1 → CustomPropertyTable) gates the identical deleteCustomPropertyByName API on EditAll and was already correct — the Profile panel was the outlier.

Fix: Gate the Panel's delete button on canEditAll (matching the PATCH endpoint's authorization, the panel's own edit action, and the Settings page), and drop the now-unused canDelete from the derived flags. One-line change in CustomPropertiesDetailPage.tsx (canDelete={canEditAll} instead of canDelete={canDelete}).

Type of change:

  • Bug fix

High-level design:

N/A — small change. One permission-gate change in one component, aligned with the existing backend contract and the sibling Settings page. Alternatives considered: registering a narrower field mapping for customProperties in ResourceRegistry and honoring it server-side so Delete covers custom-property removal — rejected, because it would diverge the type resource's patch authorization from the rest of the codebase for a single UI call site, and the Settings page already assumes EditAll.

Tests:

Use cases covered

  • A user with EditAll (but not Delete) on type sees both edit and delete actions in the Profile custom-properties panel and can delete successfully (the PATCH is satisfiable by EditAll).
  • A user with only Delete on type sees neither edit nor delete actions — preventing a visible button whose request always 403s with operations [EDIT_ALL] not allowed.
  • Profile panel and Settings page now produce identical edit/delete visibility for the same permission set against the same deleteCustomPropertyByName API.
  • Unchanged: Add button still gated on canCreate; delete flow (name-addressed test+remove patch, stale-index retry, resync on already-removed, success/error toasts, popover close behavior); sibling panels.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated:
    • openmetadata-ui/.../Profile/tabs/custom-properties/CustomPropertiesDetailPage.test.tsx — replaced the test that enshrined the bug (EditAll:false, Delete:true → delete visible) with two assertions: EditAll-only users see both edit and delete, and Delete-only users see neither (the regression guard).
  • Coverage on changed class: CustomPropertiesDetailPage.tsx 94.73% lines (≥90% target), via yarn test:coverage.

Backend integration tests

  • Not applicable (no backend API changes). The UI gate is brought into agreement with the existing backend behavior; JsonPatchUtilsTest (25/25 passing) already proves the PATCH remove on /customProperties/<i> authorizes as EDIT_ALL.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable — no new UI behavior to cover; this corrects a permission-gate mismatch. Existing specs playwright/e2e/Pages/CustomProperties.spec.ts and Features/AIMode/CustomPropertiesPanel.spec.ts continue to typecheck and lint clean.

Manual testing performed

Could not complete a live end-to-end run against a running server in this environment. Attempted, with concrete results:

  • The repo's dev-branch Docker images (2.0.0-SNAPSHOT) are not published (manifest unknown), so the quickstart stack can't start as-is.
  • Pulled the latest published server image (2.1.0) and brought the stack up (postgres + Elasticsearch + migration + server all healthy); it serves GET /api/v1/system/version → 2.1.0, but the dev-branch Playwright auth setup 404s on /api/v1/ingestionRunners, which only exists in the dev branch.
  • Ran the dev-branch server from target/classes against the running postgres + Elasticsearch; it connected and migrated but crashed during resource registration with UnhandledServerException: App Scheduler is not Initialized — a pre-existing wiring defect on main (OpenMetadataApplication.run() calls AppScheduler.getInstance().start() without any prior AppScheduler.initialize(...) call on the server command path), unrelated to this UI fix.

Unit tests and the backend contract test — which do not require a running server — fully cover the gate behavior, including the EditAll-only and Delete-only asymmetric cases.

UI screen recording:

Not applicable — standalone permission-gate fix (no new UI feature or visual change; only edit/delete menu-item visibility for edge-case permission sets). The visible menu items for default/admin/owner users (who carry both EditAll and Delete) are unchanged.

Checklist:

  • I have read the CONTRIBUTING document.
  • 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: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • 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.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge.
  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

Automatic Fixes PRs can be configured here.

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Fixes the Profile custom-properties delete action to use EditAll instead of Delete.

  • Profile custom-property delete actions now require EditAll.

Reviews (1) · Last reviewed commit: "Fixes #38345: gate Profile custom-proper..." · Reviewed by Greptile

@detail-app
detail-app Bot requested a review from a team as a code owner November 21, 2026 04:06
@detail-app
detail-app Bot requested review from Rohit0301 and karanh37 November 21, 2026 04:06
@Rohit0301
Rohit0301 merged commit 0b42912 into main Nov 23, 2026
50 checks passed
@Rohit0301
Rohit0301 deleted the detail/bug-fix/fixes-38345-gate-profile-custom-properties-delete-02374a branch November 23, 2026 05:37
Rohit0301 added a commit that referenced this pull request Nov 23, 2026
…lete (#38382) (#38430)

(cherry picked from commit 0b42912)

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
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.

[Detail Bug] Profile: Custom property delete button uses wrong permission (Delete vs EditAll), causing 403s or hidden action

2 participants