Skip to content

Commit

Permalink
fix: Ensure "Import Dashboard" menu item adheres to PVM
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed May 19, 2023
1 parent 2222073 commit 7271f86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def init_views(self) -> None:
# 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
Expand Down Expand Up @@ -334,10 +335,12 @@ def init_views(self) -> None:
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"),
Expand Down

0 comments on commit 7271f86

Please sign in to comment.