You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2024/02/22 17:41:47 UTC
(superset) 08/14: fix: Plain error message when visiting a dashboard via permalink without permissions (#27132)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7ab62e1aaa03b01f8ecb2a5accf9e31b4566359a
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Thu Feb 15 16:26:33 2024 -0500
fix: Plain error message when visiting a dashboard via permalink without permissions (#27132)
---
superset/views/core.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/superset/views/core.py b/superset/views/core.py
index 9ad2f63fdc..3e895e6b4b 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -47,6 +47,7 @@ from superset.async_events.async_query_manager import AsyncQueryTokenException
from superset.commands.chart.exceptions import ChartNotFoundError
from superset.commands.chart.warm_up_cache import ChartWarmUpCacheCommand
from superset.commands.dashboard.importers.v0 import ImportDashboardsCommand
+from superset.commands.dashboard.exceptions import DashboardAccessDeniedError
from superset.commands.dashboard.permalink.get import GetDashboardPermalinkCommand
from superset.commands.dataset.exceptions import DatasetNotFoundError
from superset.commands.explore.form_data.create import CreateFormDataCommand
@@ -880,6 +881,9 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
except DashboardPermalinkGetFailedError as ex:
flash(__("Error: %(msg)s", msg=ex.message), "danger")
return redirect("/dashboard/list/")
+ except DashboardAccessDeniedError as ex:
+ flash(__("Error: %(msg)s", msg=ex.message), "danger")
+ return redirect("/dashboard/list/")
if not value:
return json_error_response(_("permalink state not found"), status=404)
dashboard_id, state = value["dashboardId"], value.get("state", {})