superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(ui): Disable ability to export data when user does not have the correct permission

Open edjannoo opened this issue 1 year ago • 0 comments

SUMMARY

Disables Export to .JSON and Export to Excel from the Download submenu when viewing a chart unless the user has can_csv on Superset permission. The same permission is already required for Download to .CSV.

Disables DOWNLOAD TO CSV and COPY TO CLIPBOARD from the query results pane in SQL Lab unless the user has can_export_csv on SQLLab permission. The permission should be applied to both download to CSV and copy to clipboard functions since both are means of exporting data.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Verify that a user with the can_csv on Superset permission (for example a user with the Alpha role) is able to export as CSV, JSON and Excel when viewing a chart. Verify that a user without that permission is not able to do any of those.

Verify that a user with the can_export_csv on SQLLab pemission (for example a user with the sql_lab role) is able to download to CSV or copy to clipboard from the SQL Lab query results pane. Verify that a user without that permission is not able to do either of those.

ADDITIONAL INFORMATION

  • [X] Has associated issue: Fixes #19535
  • [ ] Required feature flags:
  • [X] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

edjannoo avatar May 10 '24 11:05 edjannoo