fix: Ensure "Import Dashboard" menu item adheres to PVM (#24143)

This commit is contained in:
John Bodley
2023-06-12 11:43:28 -07:00
committed by GitHub
parent a3aacf2527
commit e7b27f0778

View File

@@ -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"),