This is an automated email from the ASF dual-hosted git repository.

atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4160fed  AMBARI-24853 Cluster user can't modify shared widgets
4160fed is described below

commit 4160fed72536384a6fd250afa108c0338ea5f485
Author: Andrii Tkach <[email protected]>
AuthorDate: Thu Nov 1 14:09:59 2018 +0200

    AMBARI-24853 Cluster user can't modify shared widgets
---
 ambari-web/app/mixins/common/widgets/widget_mixin.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js 
b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index be41b40..6486856 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -677,7 +677,7 @@ App.WidgetMixin = Ember.Mixin.create({
    */
   editWidget: function (event) {
     var self = this;
-    var isShared = this.get('content.scope') == 'CLUSTER';
+    var isShared = this.get('content.scope') === 'CLUSTER';
     if (!isShared) {
       self.get('controller').editWidget(self.get('content'));
     } else {
@@ -686,7 +686,8 @@ App.WidgetMixin = Ember.Mixin.create({
         bodyClass: Em.View.extend({
           template: Ember.Handlebars.compile('{{t widget.edit.body}}')
         }),
-        primary: Em.I18n.t('widget.edit.button.primary'),
+        primary: App.isAuthorized('CLUSTER.MANAGE_WIDGETS') ? 
Em.I18n.t('widget.edit.button.primary') : null,
+        secondaryClass: App.isAuthorized('CLUSTER.MANAGE_WIDGETS') ? 
'btn-default' : 'btn-success',
         secondary: Em.I18n.t('widget.edit.button.secondary'),
         third: Em.I18n.t('common.cancel'),
         onPrimary: function () {

Reply via email to