Explorar o código

AMBARI-15423. Config tab is missing for user A if user B is running some wizard (onechiporenko)

Oleg Nechiporenko %!s(int64=9) %!d(string=hai) anos
pai
achega
3c37c38e60
Modificáronse 2 ficheiros con 11 adicións e 2 borrados
  1. 10 1
      ambari-web/app/app.js
  2. 1 1
      ambari-web/app/views/main/service/item.js

+ 10 - 1
ambari-web/app/app.js

@@ -99,7 +99,16 @@ module.exports = Em.Application.create({
            App.router.get('wizardWatcherController.isNonWizardUser');
   }.property('upgradeIsRunning', 'upgradeAborted', 'router.wizardWatcherController.isNonWizardUser'),
 
+  /**
+   * Options:
+   *  - ignoreWizard: ignore when some wizard is running by another user (default `false`)
+   *
+   * @param {string} authRoles
+   * @param {object} options
+   * @returns {boolean}
+   */
   isAuthorized: function(authRoles, options) {
+    options = $.extend({ignoreWizard: false}, options);
     var result = false;
     authRoles = $.map(authRoles.split(","), $.trim);
 
@@ -110,7 +119,7 @@ module.exports = Em.Application.create({
       return false;
     }
 
-    if (App.router.get('wizardWatcherController.isNonWizardUser')) {
+    if (!options.ignoreWizard && App.router.get('wizardWatcherController.isNonWizardUser')) {
       return false;
     }
 

+ 1 - 1
ambari-web/app/views/main/service/item.js

@@ -294,7 +294,7 @@ App.MainServiceItemView = Em.View.extend({
   }.property('maintenance'),
 
   hasConfigTab: function() {
-    return App.isAuthorized('CLUSTER.VIEW_CONFIGS') && !App.get('services.noConfigTypes').contains(this.get('controller.content.serviceName'));
+    return App.isAuthorized('CLUSTER.VIEW_CONFIGS', {ignoreWizard: true}) && !App.get('services.noConfigTypes').contains(this.get('controller.content.serviceName'));
   }.property('controller.content.serviceName','App.services.noConfigTypes'),
 
   hasHeatmapTab: function() {