diff --git a/superset/views/core.py b/superset/views/core.py index c8336521fcb1..cc349d9f3258 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -46,6 +46,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.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 @@ -832,6 +833,9 @@ def dashboard_permalink( 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", {})