-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add permission checks to save_or_overwrite_slice #4346
Conversation
superset/views/core.py
Outdated
@@ -1182,6 +1182,11 @@ def explore(self, datasource_type, datasource_id): | |||
"You don't have the rights to alter this slice", | |||
status=400) | |||
|
|||
if action == 'saveas' and not slice_add_perm: | |||
return json_error_response( | |||
"You don't have the rights to create this slice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You be great to make this translatable using _("Translatable")
. Also we're moving away from slice
in favor of chart
.
To minimize the number of strings to translate you may want to break it into chunks:
_("You don't have the rights to ") + _("create this ") + _("slice")
Sorry our linter configuration is picky about As a sidenote (may be out-of-scope for this PR) we need to write a solid test suite around accessibility/security. I'll create an issue for it. |
* Add permissions checks for save_or_overwrite_slice * Change is_owner to check_ownership * Add translation to chart and dashboard error messages * Appease the python linter by using single quotes
* Add permissions checks for save_or_overwrite_slice * Change is_owner to check_ownership * Add translation to chart and dashboard error messages * Appease the python linter by using single quotes
This PR is meant to resolve issue #3498
saveas
toexplore
requestadd_to_dash == existing
toexplore
requestadd_to_dash == new
toexplore
request