Repository navigation
fix(datasets): follow semantic view modification permissions - #46448
mikebridge merged 4 commits into
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
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.
|
Thanks @aminghadersohi. Agreed on the nit. When I'll correct that message in a small follow-up after this merges, so this approved head stays as reviewed. |
* 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
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.
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
can_modifyboolean on semantic rows in the combined datasource response