Browse Source

HUE-8945 [importer] Metadata app should not be blacklistable

Properly disable importer by additionaly looking if there is no FS.
Romain 6 years ago
parent
commit
03981c392e

+ 4 - 3
desktop/core/src/desktop/models.py

@@ -1867,7 +1867,7 @@ class ClusterConfig(object):
         'page': '/security/hive'
       })
 
-    if 'indexer' in self.apps and self.user.has_hue_permission(action="access:importer", app="indexer") and not IS_EMBEDDED.get():
+    if 'indexer' in self.apps and 'filebrowser' in self.apps and self.user.has_hue_permission(action="access:importer", app="indexer") and not IS_EMBEDDED.get():
       interpreters.append({
         'type': 'importer',
         'displayName': _('Importer'),
@@ -1989,8 +1989,9 @@ def _get_apps(user, section=None):
     apps = list(apps_list.values())
     for app in apps:
       if app.display_name not in [
-          'beeswax', 'hive', 'impala', 'pig', 'jobsub', 'jobbrowser', 'metastore', 'hbase', 'sqoop', 'oozie', 'filebrowser',
-          'useradmin', 'search', 'help', 'about', 'zookeeper', 'proxy', 'rdbms', 'spark', 'indexer', 'security', 'notebook'] and app.menu_index != -1:
+            'beeswax', 'hive', 'impala', 'pig', 'jobsub', 'jobbrowser', 'metastore', 'hbase', 'sqoop', 'oozie', 'filebrowser',
+            'useradmin', 'search', 'help', 'about', 'zookeeper', 'proxy', 'rdbms', 'spark', 'indexer', 'security', 'notebook'
+          ] and app.menu_index != -1:
         other_apps.append(app)
       if section == app.display_name:
         current_app = app

+ 6 - 6
desktop/core/src/desktop/templates/global_js_constants.mako

@@ -84,13 +84,13 @@
 
   window.ENABLE_SQL_SYNTAX_CHECK = '${ conf.ENABLE_SQL_SYNTAX_CHECK.get() }' === 'True';
 
-  window.HAS_CATALOG = '${ 'metadata' in apps and has_catalog(request.user) }' === 'True';
-  window.CATALOG_URL = '${ 'metadata' in apps and get_catalog_url() or "" }'
-  window.HAS_READ_ONLY_CATALOG = '${ 'metadata' in apps and has_readonly_catalog(request.user) }' === 'True' || '${ has_write_access(request.user) }' === 'False';
+  window.HAS_CATALOG = '${ has_catalog(request.user) }' === 'True';
+  window.CATALOG_URL = '${ get_catalog_url() or "" }'
+  window.HAS_READ_ONLY_CATALOG = '${ has_readonly_catalog(request.user) }' === 'True' || '${ has_write_access(request.user) }' === 'False';
 
-  window.HAS_OPTIMIZER = '${ 'metadata' in apps and has_optimizer() }' === 'True';
-  window.OPTIMIZER_URL = '${ 'metadata' in apps and get_optimizer_url() }'
-  window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ 'metadata' in apps and OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
+  window.HAS_OPTIMIZER = '${ has_optimizer() }' === 'True';
+  window.OPTIMIZER_URL = '${ get_optimizer_url() }'
+  window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
 
   ## In the past was has_workload_analytics()
   window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';