mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(dashboard-rbac): use normal rbac when no roles chosen (#23586)
This commit is contained in:
@@ -116,9 +116,7 @@ def on_security_exception(self: Any, ex: Exception) -> Response:
|
||||
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
def check_dashboard_access(
|
||||
on_error: Callable[..., Any] = on_security_exception
|
||||
) -> Callable[..., Any]:
|
||||
def check_dashboard_access(on_error: Callable[[str], Any]) -> Callable[..., Any]:
|
||||
def decorator(f: Callable[..., Any]) -> Callable[..., Any]:
|
||||
@wraps(f)
|
||||
def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
|
||||
@@ -130,7 +128,7 @@ def check_dashboard_access(
|
||||
try:
|
||||
current_app.appbuilder.sm.raise_for_dashboard_access(dashboard)
|
||||
except DashboardAccessDeniedError as ex:
|
||||
return on_error(self, ex)
|
||||
return on_error(str(ex))
|
||||
except Exception as exception:
|
||||
raise exception
|
||||
|
||||
|
||||
Reference in New Issue
Block a user