mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: Ensure "Import Dashboard" menu item adheres to PVM (#24143)
This commit is contained in:
@@ -116,6 +116,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
# the global Flask app
|
||||
#
|
||||
# pylint: disable=import-outside-toplevel,too-many-locals,too-many-statements
|
||||
from superset import security_manager
|
||||
from superset.advanced_data_type.api import AdvancedDataTypeRestApi
|
||||
from superset.annotation_layers.annotations.api import AnnotationRestApi
|
||||
from superset.annotation_layers.api import AnnotationLayerRestApi
|
||||
@@ -333,10 +334,12 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
category="Manage",
|
||||
category_label=__("Manage"),
|
||||
category_icon="fa-wrench",
|
||||
cond=lambda: not feature_flag_manager.is_feature_enabled(
|
||||
"VERSIONED_EXPORT"
|
||||
cond=lambda: (
|
||||
security_manager.can_access("can_import_dashboards", "Superset")
|
||||
and not feature_flag_manager.is_feature_enabled("VERSIONED_EXPORT")
|
||||
),
|
||||
)
|
||||
|
||||
appbuilder.add_link(
|
||||
"SQL Editor",
|
||||
label=__("SQL Lab"),
|
||||
|
||||
Reference in New Issue
Block a user