Skip to content

fix(datasets): follow semantic view modification permissions - #46448

Open
mikebridge wants to merge 3 commits into
apache:masterfrom
mikebridge:fix-dataset-list-bulk-delete-eligibility
Open

mikebridge wants to merge 3 commits into
apache:masterfrom
mikebridge:fix-dataset-list-bulk-delete-eligibility

Conversation

@mikebridge

Copy link
Copy Markdown
Member

SUMMARY

Make semantic-view Edit, Delete and bulk-delete controls follow the server's modification rule. A creator or resolver-granted editor can use the actions when they also have SemanticView write permission and access to the view. The combined datasource list supplies a boolean instead of exposing creator/editor identities or reconstructing the rule in the browser.

Selections containing a semantic view the user cannot modify are refused before confirmation or destructive requests. Selection and export remain available. Ordinary dataset behavior is unchanged for Dataset writers; a user with only SemanticView write cannot use the newly available bulk controls to delete ordinary datasets. Commands still recheck permissions and deletion dependencies; the flag is not an authorization token.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: semantic-view actions used an admin-only UI approximation and misleading tooltips. After: row actions and bulk eligibility use the server result, with a permission message for denied views. No browser check was run; no screenshots are claimed.

TESTING INSTRUCTIONS

Automated checks: 276 focused Python tests, 182 DatasetList Jest tests across eight suites, frontend TypeScript, changed-file hooks and POT drift check passed. With real database roles and permission lookups, a non-admin writer with all-datasource access takes 11 statements for both one and 25 semantic views, versus 8 and 32 on the base. The SQLite fixture has distinct creators/layers, a cold identity map and preloaded login role/group relationships. Repeated permission checks are memoized only during serialization; distinct per-view grants still need their first lookup, and a custom extra-editor resolver still runs per eligible row with its own cost. No universal production query bound is claimed.

To check manually with semantic layers enabled, compare an admin, a view creator, a resolver-granted editor and an unrelated writer. Verify Edit/Delete and bulk-delete permission messages follow SemanticView write permission and view access. Include a denied view in a mixed selection: no confirmation or delete request should occur. Verify ordinary dataset actions/export remain unchanged and server dependency refusals still appear for eligible views.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: SEMANTIC_LAYERS
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API: additive can_modify boolean on semantic rows in the combined datasource response
  • Removes existing feature or API

@github-actions github-actions Bot added i18n Namespace | Anything related to localization doc Namespace | Anything related to documentation labels Nov 21, 2026
@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.77465% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.93%. Comparing base (5ef84de) to head (6d2f061).

Files with missing lines Patch % Lines
superset/commands/datasource/list.py 80.00% 0 Missing and 2 partials ⚠️
superset/security/manager.py 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #46448   +/-   ##
=======================================
  Coverage   85.92%   85.93%           
=======================================
  Files        3122     3122           
  Lines      216903   216949   +46     
  Branches    51423    51433   +10     
=======================================
+ Hits       186380   186428   +48     
+ Misses      27106    27103    -3     
- Partials     3417     3418    +1     
Flag Coverage Δ
hive 33.88% <32.50%> (+<0.01%) ⬆️
javascript 82.76% <100.00%> (+<0.01%) ⬆️
mysql 51.56% <70.00%> (+<0.01%) ⬆️
postgres 51.58% <70.00%> (+<0.01%) ⬆️
presto 35.55% <32.50%> (+<0.01%) ⬆️
python 88.42% <92.50%> (+<0.01%) ⬆️
sqlite 51.26% <70.00%> (+<0.01%) ⬆️
unit 83.85% <92.50%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 6d2f0613fd33

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can_modify matches the SemanticView PUT/DELETE/bulk-delete checks and the list gates follow it.

Nit: In deletePermissionError, a SemanticView-only writer bulk-deleting an ordinary dataset is told to become a dataset editor, not that Dataset write is missing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants