refactor(ui): share asset wipe permission logic - #34041
Open
sidsri14 wants to merge 1 commit into
Open
Conversation
sidsri14
marked this pull request as ready for review
July 24, 2026 09:38
Contributor
Greptile SummaryCentralizes the asset-wipe permission cascade and reuses it across single-asset and multi-asset wipe actions.
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The shared predicate preserves the prior permission ordering and both current wipe paths supply the inputs needed to evaluate deployment-wide, location-scoped, and per-asset grants.
|
| Filename | Overview |
|---|---|
| js_modules/ui-core/src/assets/assetWipePermissions.ts | Introduces a shared predicate that preserves the existing three-level wipe-permission cascade. |
| js_modules/ui-core/src/assets/useWipeDialog.tsx | Delegates single-asset wipe authorization to the shared predicate without changing behavior for current callers. |
| js_modules/ui-core/src/assets/useWipeMaterializations.tsx | Delegates each selected asset's authorization check to the shared predicate while retaining all-assets-required semantics. |
| js_modules/ui-core/src/assets/tests/assetWipePermissions.test.ts | Covers every permission level, complete denial, and rejection of permission from an unrelated location. |
Reviews (1): Last reviewed commit: "refactor(ui): share asset wipe permissio..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The two wipe hooks implemented the same three-level permission rule independently. Keeping the rule in one predicate prevents the single-asset and multi-asset paths from diverging when permission behavior changes.
Fixes #34001
Validation
yarn workspace @dagster-io/ui-core eslint src/assets/assetWipePermissions.ts src/assets/__tests__/assetWipePermissions.test.ts src/assets/useWipeDialog.tsx src/assets/useWipeMaterializations.tsxyarn workspace @dagster-io/ui-core tsyarn workspace @dagster-io/ui-core jest src/assets/__tests__/useAssetsPermissions.test.tsx src/assets/__tests__/assetWipePermissions.test.ts --runInBand(10 passed)yarn workspace @dagster-io/ui-core jest-all-silent(160 suites, 1,314 passed, 4 skipped)