mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
Small fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user