Procházet zdrojové kódy

AMBARI-19286. Handle permissions for setting service auto start in FE (alexantonenko)

Alex Antonenko před 8 roky
rodič
revize
0a62d19a7a

+ 1 - 1
ambari-web/app/templates/main/admin/service_auto_start.hbs

@@ -63,7 +63,7 @@
                                 </div>
                             </div>
                         {{/each}}
-                        {{#isAuthorized "SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS"}}
+                        {{#isAuthorized "SERVICE.MANAGE_AUTO_START"}}
                             <div class="offset4">
                                 <a href="#" class="enable-all-link" {{action enableAll tab target="controller"}}>{{t common.enableAll}}</a> |
                                 <a href="#" {{action disableAll tab target="controller"}}>{{t common.disableAll}}</a>

+ 1 - 1
ambari-web/app/views/main/admin/service_auto_start.js

@@ -34,7 +34,7 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
 
   didInsertElement: function () {
     var self = this;
-    this.set('isDisabled', !App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS'));
+    this.set('isDisabled', !App.isAuthorized('CLUSTER.MANAGE_AUTO_START'));
     this.get('controller').loadClusterConfig().done(function (data) {
       var tag = [
         {

+ 1 - 1
ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js

@@ -56,7 +56,7 @@ App.MainAdminServiceAutoStartComponentView = Em.View.extend({
         offText: Em.I18n.t('common.disabled'),
         offColor: 'default',
         onColor: 'success',
-        disabled: this.get('parentView.isDisabled'),
+        disabled: !App.isAuthorized('SERVICE.MANAGE_AUTO_START'),
         handleWidth: Math.max(Em.I18n.t('common.enabled').length, Em.I18n.t('common.disabled').length) * 8,
         onSwitchChange: function (event, state) {
           self.set('tab.enabledComponents', self.get('tab.enabledComponents') + (state ? 1 : -1));