Skip to content

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

Merged
mikebridge merged 4 commits into
apache:masterfrom
mikebridge:fix-dataset-list-bulk-delete-eligibility
Nov 22, 2026
Merged

mikebridge merged 4 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.92%. Comparing base (5ef84de) to head (793e051).
⚠️ Report is 1 commits behind head on master.

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.92%   -0.01%     
==========================================
  Files        3122     3122              
  Lines      216903   216949      +46     
  Branches    51423    51433      +10     
==========================================
+ Hits       186380   186419      +39     
- Misses      27106    27112       +6     
- Partials     3417     3418       +1     
Flag Coverage Δ
hive 33.88% <32.50%> (+<0.01%) ⬆️
javascript 82.75% <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

codeant-ai-for-open-source Bot commented Nov 22, 2026 •

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: 793e0511cbf2

@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.

@mikebridge

Copy link
Copy Markdown
Member Author

Thanks @aminghadersohi. Agreed on the nit. When canDelete is false because Dataset write is missing, the ordinary-dataset branch still says "You must be a dataset editor", which points a SemanticView-only writer at the wrong fix.

I'll correct that message in a small follow-up after this merges, so this approved head stays as reviewed.

@github-actions github-actions Bot removed the doc Namespace | Anything related to documentation label Nov 22, 2026
@mikebridge

Copy link
Copy Markdown
Member Author

The documentation paragraph has moved to #46462 for separate docs review. Commit 793e051 only removes that paragraph; the code and tests are unchanged since Amin’s approval. CI is green, and GitHub has retained the approval.

@mikebridge
mikebridge merged commit 44a2f39 into apache:master Nov 22, 2026
80 checks passed
jprinet added a commit to jprinet/superset that referenced this pull request Nov 23, 2026
* origin/master: (393 commits)
  fix(a11y): name the semantic view description input (apache#46458)
  docs(semantic): explain datasource list modification eligibility (apache#46462)
  docs(semantic-layer): document NULL-preserving exclusion filters (apache#46447)
  fix(uploads): skip folder and system entries in columnar ZIP uploads (apache#45617)
  fix(i18n-es): promote 47 of the zero-context backfill entries (apache#45847)
  fix(mcp): return structured ChartError on SQLAlchemyError in get_chart_sql (apache#44351)
  fix(datasets): follow semantic view modification permissions (apache#46448)
  fix(docker): account for container memory limits in frontend-mem-nag.sh (apache#46373)
  fix(reports): carry the report's native filters in the email and Slack link (apache#46062)
  fix(explore): apply the dataset timezone to grained temporal filter values (apache#46175)
  fix(i18n): enforce the do-not-translate registry across the catalogs (apache#45974)
  chore(logging): log unparseable virtual dataset SQL at debug in the RLS lookup (apache#46139)
  fix(i18n): split parameter-suggestion plural into two messages (apache#46049)
  test(partition-mapping): cover Hive/Impala mirrored SQL, cache outage and migration (apache#46319)
  perf(dashboard): look up the dashboard once per filter_state read (apache#46314)
  fix(i18n): load the dayjs locale for every language with a catalog (apache#45982)
  test(semantic-layer): make date export parametrization deterministic (apache#46449)
  fix(oauth2): idempotent OAuth2 completion and resilient listener (apache#40292)
  fix(explore): prevent full table scan when SQL expression is used as x-axis (apache#41339)
  feat(mcp): radar chart type plugin (apache#43571)
  ...

# Conflicts:
#	.github/workflows/docker.yml
#	.github/workflows/superset-frontend.yml
uhyunpark added a commit to uhyunpark/superset that referenced this pull request Nov 25, 2026
master's can_access gained a scoped cache (cache_permission_checks, apache#46448). Both are kept: the scope is taken as on master, and the request memo answers the signed-in lookup behind it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants