You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2015/12/10 23:26:22 UTC
ambari git commit: AMBARI-14308. RBAC: "Cluster User" should not be
able to "start/stop/restart service component" component on "Host Actions"
(rzang)
Repository: ambari
Updated Branches:
refs/heads/trunk f790baac4 -> 3559218e3
AMBARI-14308. RBAC: "Cluster User" should not be able to "start/stop/restart service component" component on "Host Actions" (rzang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3559218e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3559218e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3559218e
Branch: refs/heads/trunk
Commit: 3559218e37d7f11eadabdd5ea3cb6415796d56ac
Parents: f790baa
Author: Richard Zang <rz...@apache.org>
Authored: Thu Dec 10 14:18:17 2015 -0800
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Dec 10 14:22:16 2015 -0800
----------------------------------------------------------------------
ambari-web/app/views/main/host/details.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3559218e/ambari-web/app/views/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details.js b/ambari-web/app/views/main/host/details.js
index 38a18e3..5b42766 100644
--- a/ambari-web/app/views/main/host/details.js
+++ b/ambari-web/app/views/main/host/details.js
@@ -41,12 +41,15 @@ App.MainHostDetailsView = Em.View.extend({
maintenance: function(){
var onOff = this.get('isActive') ? "On" : "Off";
- var result = [
- {action: 'startAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-play', 'label': this.t('hosts.host.details.startAllComponents')},
- {action: 'stopAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-stop', 'label': this.t('hosts.host.details.stopAllComponents')},
- {action: 'restartAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-repeat', 'label': this.t('hosts.host.details.restartAllComponents')},
- {action: 'setRackId', liClass:'', cssClass: 'icon-gear', 'label': this.t('hosts.host.details.setRackId')}
- ];
+ var result = [];
+ if (App.isAuthorized("SERVICE.START_STOP")) {
+ result = result.concat([
+ {action: 'startAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-play', 'label': this.t('hosts.host.details.startAllComponents')},
+ {action: 'stopAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-stop', 'label': this.t('hosts.host.details.stopAllComponents')},
+ {action: 'restartAllComponents', liClass: (this.get('controller.content.isNotHeartBeating')?'disabled':'enabled'), cssClass: 'icon-repeat', 'label': this.t('hosts.host.details.restartAllComponents')}
+ ]);
+ }
+ result.push({action: 'setRackId', liClass:'', cssClass: 'icon-gear', 'label': this.t('hosts.host.details.setRackId')});
if (App.isAuthorized("HOST.TOGGLE_MAINTENANCE")) {
result.push({action: 'onOffPassiveModeForHost', liClass:'', cssClass: 'icon-medkit', active:this.get('isActive'), 'label': this.t('passiveState.turn' + onOff)});
}