Skip to content
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

fix: Update http error code from 400 to 403 for permission error #13061

Merged
merged 1 commit into from
Feb 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,13 @@ def explore( # pylint: disable=too-many-locals,too-many-return-statements
if action == "overwrite" and not slice_overwrite_perm:
return json_error_response(
_("You don't have the rights to ") + _("alter this ") + _("chart"),
status=400,
status=403,
)

if action == "saveas" and not slice_add_perm:
return json_error_response(
_("You don't have the rights to ") + _("create a ") + _("chart"),
status=400,
status=403,
)

if action in ("saveas", "overwrite") and datasource:
Expand Down Expand Up @@ -929,7 +929,7 @@ def save_or_overwrite_slice(
_("You don't have the rights to ")
+ _("alter this ")
+ _("dashboard"),
status=400,
status=403,
)

flash(
Expand All @@ -947,7 +947,7 @@ def save_or_overwrite_slice(
_("You don't have the rights to ")
+ _("create a ")
+ _("dashboard"),
status=400,
status=403,
)

dash = Dashboard(
Expand Down