fix(explore): Display missing dataset for denied access (#34129)

This commit is contained in:
JUST.in DO IT
2025-07-16 13:36:03 -07:00
committed by GitHub
parent 94d47113ea
commit 96cb6030c8
10 changed files with 263 additions and 78 deletions

View File

@@ -27,6 +27,7 @@ from superset.commands.temporary_cache.exceptions import (
TemporaryCacheResourceNotFoundError,
)
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP
from superset.exceptions import SupersetSecurityException
from superset.explore.exceptions import DatasetAccessDeniedError, WrongEndpointError
from superset.explore.permalink.exceptions import ExplorePermalinkGetFailedError
from superset.explore.schemas import ExploreContextSchema
@@ -118,6 +119,11 @@ class ExploreRestApi(BaseSupersetApi):
return self.response(200, result=result)
except ValueError as ex:
return self.response(400, message=str(ex))
except SupersetSecurityException as ex:
return self.response(
403,
**ex.to_dict(),
)
except DatasetAccessDeniedError as ex:
return self.response(
403,