Small fixes

This commit is contained in:
Beto Dealmeida
2026-04-16 18:55:48 -04:00
parent 5d6ce82651
commit 0d09ecaae1
7 changed files with 5097 additions and 5405 deletions

View File

@@ -56,7 +56,7 @@ from superset.commands.semantic_layer.update import (
UpdateSemanticViewCommand,
)
from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP
from superset.daos.semantic_layer import SemanticLayerDAO, SemanticViewDAO
from superset.daos.semantic_layer import SemanticLayerDAO
from superset.datasets.schemas import get_delete_ids_schema
from superset.models.core import Database
from superset.semantic_layers.models import SemanticLayer, SemanticView
@@ -175,6 +175,11 @@ class SemanticViewRestApi(BaseSupersetModelRestApi):
class_permission_name = "SemanticView"
method_permission_name = MODEL_API_RW_METHOD_PERMISSION_MAP
include_route_methods = {"put", "post", "delete", "bulk_delete"}
# SemanticViewRestApi exposes only write endpoints, but can_read must be
# declared explicitly so that FAB registers the permission. It is used by
# DatasourceRestApi.combined_list to gate access to semantic views in the
# combined datasource list.
base_permissions = ["can_read", "can_write"]
edit_model_schema = SemanticViewPutSchema()
@@ -635,7 +640,7 @@ class SemanticLayerRestApi(BaseSupersetApi):
)
# Check which views already exist with the same runtime config
existing = SemanticViewDAO.find_by_semantic_layer(str(layer.uuid))
existing = SemanticLayerDAO.get_semantic_views(str(layer.uuid))
existing_keys: set[tuple[str, str]] = set()
for v in existing:
config = v.configuration