superset icon indicating copy to clipboard operation
superset copied to clipboard

Chart "save" behaviors not permission controlled

Open micimize opened this issue 7 years ago • 12 comments

Chart save actions should be disabled in the UI when they are not allowed (save button, ctrl-s)

Expected results

  • Save button is disabled when can_add: false, can_overwrite: false
  • ctrl-s is disabled and copy reflects it (less important)

Actual results

  • Save button is not disabled when can_add: false, can_overwrite: false
  • The opened modal is broken/unresponsive
  • ctrl-s fires an overwrite attempt (regardless of permissions) and just fails due to undefined data results in https://github.com/apache/incubator-superset/blob/0a8f3eb43ff068a8612338015f605f1951ce57b6/superset/assets/src/explore/components/ExploreViewContainer.jsx#L189

Screenshots

image

How to reproduce the bug

Go to a chart with a user who cannot overwrite or copy the chart

Environment

  • superset version: container built from a fork of very-recent master

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • [X] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [X] I have reproduced the issue with at least the latest released version of superset.
  • [X] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional Context

I think we can just add can_add to where can_overwrite is provided and pass it down properly to canAdd.

micimize avatar Sep 26 '19 17:09 micimize

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.90. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Sep 26 '19 17:09 issue-label-bot[bot]

any solution? I don't want other users to overwrite charts.

Towhid1 avatar Nov 18 '19 03:11 Towhid1

@Towhid1 if permissions are set correctly they can't, it just errors out when a user tries to

micimize avatar Nov 18 '19 03:11 micimize

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jan 17 '20 03:01 stale[bot]

The patch for this from https://github.com/edf-org/incubator-superset/commit/cbc068fc4dfac9afbd7f27397c6531e9c24fcfe9#diff-a03acc80c87baf6ec15dd2d31f093d47

image

micimize avatar Jan 17 '20 03:01 micimize

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Mar 17 '20 04:03 stale[bot]

bump - code looks the same

micimize avatar Mar 17 '20 15:03 micimize

@micimize would you be willing to open a PR, given that you have a patch in place?

willbarrett avatar Mar 31 '20 20:03 willbarrett

@willbarrett sure! I narrowed the commit scope and will test locally and PR soon 👍

micimize avatar Apr 02 '20 16:04 micimize

Awesome, thanks!

willbarrett avatar Apr 02 '20 16:04 willbarrett

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jun 02 '20 07:06 stale[bot]

bump – rebased the PR against master

micimize avatar Jun 02 '20 15:06 micimize