Update http error code from 400 to 403 (#13061)

This commit is contained in:
Duy Nguyen Hoang
2021-02-13 18:32:21 +07:00
committed by GitHub
parent dae1258903
commit 56fca17e62

View File

@@ -766,13 +766,13 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
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:
@@ -928,7 +928,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
_("You don't have the rights to ")
+ _("alter this ")
+ _("dashboard"),
status=400,
status=403,
)
flash(
@@ -946,7 +946,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
_("You don't have the rights to ")
+ _("create a ")
+ _("dashboard"),
status=400,
status=403,
)
dash = Dashboard(