git commit: AMBARI-7216. Mapreduce is recommending a value that isn't set. (akovalenko)

2014-09-09 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 2ef3506a9 - 0e3fd88b8


AMBARI-7216. Mapreduce is recommending a value that isn't set. (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0e3fd88b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0e3fd88b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0e3fd88b

Branch: refs/heads/trunk
Commit: 0e3fd88b85841487715e65b5538bf76b4bb58841
Parents: 2ef3506
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Tue Sep 9 13:59:22 2014 +0300
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Tue Sep 9 13:59:22 2014 +0300

--
 ambari-web/app/models/stack_service.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e3fd88b/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index ec7bcd4..edef8ce 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -259,7 +259,8 @@ App.StackService.configCategories = function () {
   break;
 case 'MAPREDUCE2':
   serviceConfigCategories.pushObjects([
-App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 
'History Server'})
+App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 
'History Server'}),
+App.ServiceConfigCategory.create({ name: 'General', displayName: 
'General'})
   ]);
   break;
 case 'HIVE':



git commit: AMBARI-7217. Ambari does not update ha.zookeeper.quorum property in core-site.xml file even if there are more than 3 ZooKeeper servers configured via Ambari.. (onechiporenko)

2014-09-09 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 0e3fd88b8 - daae69eba


AMBARI-7217. Ambari does not update ha.zookeeper.quorum property in 
core-site.xml file even if there are more than 3 ZooKeeper servers configured 
via Ambari.. (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/daae69eb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/daae69eb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/daae69eb

Branch: refs/heads/trunk
Commit: daae69ebac0ac72a71cf9c8b7d744aaea5aa6d56
Parents: 0e3fd88
Author: Oleg Nechiporenko onechipore...@apache.org
Authored: Tue Sep 9 16:03:54 2014 +0300
Committer: Oleg Nechiporenko onechipore...@apache.org
Committed: Tue Sep 9 16:03:54 2014 +0300

--
 ambari-web/app/controllers/main/host/details.js | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/daae69eb/ambari-web/app/controllers/main/host/details.js
--
diff --git a/ambari-web/app/controllers/main/host/details.js 
b/ambari-web/app/controllers/main/host/details.js
index 911e5c2..a9b7d76 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -564,7 +564,11 @@ App.MainHostDetailsController = Em.Controller.extend({
   checkZkConfigs: function () {
 var bg = 
App.router.get('backgroundOperationsController.services').findProperty('id', 
this.get('zkRequestId'));
 if (bg  !bg.get('isRunning')) {
-  this.loadConfigs();
+  var self = this;
+  
this.removeObserver('App.router.backgroundOperationsController.serviceTimestamp',
 this, this.checkZkConfigs);
+  setTimeout(function () {
+self.loadConfigs();
+  }, App.get('componentsUpdateInterval'));
 }
   },
 
@@ -573,7 +577,6 @@ App.MainHostDetailsController = Em.Controller.extend({
* @method loadConfigs
*/
   loadConfigs: function () {
-
this.removeObserver('App.router.backgroundOperationsController.serviceTimestamp',
 this, this.checkZkConfigs);
 App.ajax.send({
   name: 'config.tags',
   sender: this,



git commit: AMBARI-7218. rename host group deletes configs (dlysnichenko)

2014-09-09 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk daae69eba - 9ce44c953


AMBARI-7218. rename host group deletes configs (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9ce44c95
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9ce44c95
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9ce44c95

Branch: refs/heads/trunk
Commit: 9ce44c953de1154883887538c5979e5d9036a30c
Parents: daae69e
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Sep 8 21:48:15 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Sep 9 16:16:42 2014 +0300

--
 .../internal/ConfigGroupResourceProvider.java   | 136 ---
 .../ConfigGroupResourceProviderTest.java| 130 ++
 2 files changed, 217 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9ce44c95/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 6e13d9c..52df317 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -383,6 +383,36 @@ public class ConfigGroupResourceProvider extends
 cluster.deleteConfigGroup(request.getId());
   }
 
+  private void basicRequestValidation(ConfigGroupRequest request) {
+if (request.getId() == null
+|| request.getClusterName() == null
+|| request.getClusterName().isEmpty()
+|| request.getGroupName() == null
+|| request.getGroupName().isEmpty()) {
+  LOG.debug(Received a config group request with request id =  +
+  request.getId() + , cluster name =  +
+  request.getClusterName() + , group name =  + 
request.getGroupName());
+  throw new IllegalArgumentException(Request id,  +
+  cluster name and  +
+  group name have to be provided.);
+}
+  }
+
+  private void validateRenameRequest(ConfigGroupRequest request) {
+if (request.getTag() != null
+|| (request.getHosts() != null  ! request.getHosts().isEmpty())
+|| request.getDescription() != null
+|| request.getServiceConfigVersionNote() != null
+|| (request.getConfigs()!=null  ! 
request.getConfigs().isEmpty())) {
+  throw new IllegalArgumentException(Request with id  +
+  request.getId() +
+   seems to be a config group rename request.  +
+  Renaming config group can not be combined with other  +
+  operations, so hosts, configs, description, service config 
version note  +
+  request fields should not be populated.);
+}
+  }
+
   private void validateRequest(ConfigGroupRequest request) {
 if (request.getClusterName() == null
   || request.getClusterName().isEmpty()
@@ -504,81 +534,89 @@ public class ConfigGroupResourceProvider extends
 Clusters clusters = getManagementController().getClusters();
 
 for (ConfigGroupRequest request : requests) {
+  basicRequestValidation(request);
 
   Cluster cluster;
   try {
 cluster = clusters.getCluster(request.getClusterName());
   } catch (ClusterNotFoundException e) {
 throw new ParentObjectNotFoundException(
-  Attempted to add a config group to a cluster which doesn't exist, 
e);
+  String.format(
+The cluster %s does not exist, can not update a config group,
+  request.getClusterName()), e);
   }
 
-  if (request.getId() == null) {
-throw new AmbariException(Config group Id is a required parameter.);
-  }
-
-  validateRequest(request);
-
   // Find config group
-  ConfigGroup configGroup = cluster.getConfigGroups().get(request.getId());
+  MapLong, ConfigGroup configGroups = cluster.getConfigGroups();
+  ConfigGroup configGroup = configGroups.get(request.getId());
   if (configGroup == null) {
 throw new AmbariException(Config group not found
  + , clusterName =  + 
request.getClusterName()
  + , groupId =  + request.getId());
   }
-  String serviceName = configGroup.getServiceName();
-  String requestServiceName = 
cluster.getServiceForConfigTypes(request.getConfigs().keySet());
-  if (serviceName != null  

git commit: AMBARI-7219. Slider View: FE - view appears squished inhibiting operation (alexantonenko)

2014-09-09 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 9ce44c953 - 8f287ce38


AMBARI-7219. Slider View: FE - view appears squished inhibiting operation 
(alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8f287ce3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8f287ce3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8f287ce3

Branch: refs/heads/trunk
Commit: 8f287ce38d9a692b25119efebb5a95a0c76595f2
Parents: 9ce44c9
Author: Alex Antonenko hiv...@gmail.com
Authored: Tue Sep 9 16:20:01 2014 +0300
Committer: Alex Antonenko hiv...@gmail.com
Committed: Tue Sep 9 16:25:40 2014 +0300

--
 ambari-web/app/assets/licenses/NOTICE.txt   |   4 +-
 ambari-web/app/styles/application.less  |   1 +
 ambari-web/app/views/main/views/details.js  |  28 ---
 .../jquery.iframe-auto-height.plugin.1.9.5.js   | 224 ---
 4 files changed, 2 insertions(+), 255 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f287ce3/ambari-web/app/assets/licenses/NOTICE.txt
--
diff --git a/ambari-web/app/assets/licenses/NOTICE.txt 
b/ambari-web/app/assets/licenses/NOTICE.txt
index 82231f0..d535f1f 100644
--- a/ambari-web/app/assets/licenses/NOTICE.txt
+++ b/ambari-web/app/assets/licenses/NOTICE.txt
@@ -10,7 +10,7 @@ This product includes Ember.js (http://emberjs.com - 
https://github.com/emberjs/
 Copyright (c) 2011, Yehuda Katz, Tom Dale, Charles Jolley and Ember.js 
contributors
 
 This product was generated using Brunch 
(https://github.com/brunch/brunch/blob/master/LICENSE)
-Copyright (c) 2011, Allan Berger, Jan Monschke, Martin Schürrer, Thomas 
Schranz, Nik Graf, Paul Miller
+Copyright (c) 2011, Allan Berger, Jan Monschke, Martin Sch\u00FCrrer, Thomas 
Schranz, Nik Graf, Paul Miller
 
 This product includes Twitter Bootstrap 2 
(http://twitter.github.com/bootstrap/ - Apache License v2.0.)
 
@@ -43,5 +43,3 @@ This product includes Spin.js 
(http://fgnass.github.com/spin.js/ - MIT license)
 Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
 
 This product includes Moment.js (https://github.com/moment/moment/ - MIT 
license)
-
-This product includes iframeAutoHeight.js 
(http://github.com/house9/jquery-iframe-auto-height - MIT license)

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f287ce3/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 1a63440..eb33e6d 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -6859,6 +6859,7 @@ i.icon-asterisks {
 }
 .views_sizes {
   width:100%;
+  min-height:600px;
   border: 0;
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f287ce3/ambari-web/app/views/main/views/details.js
--
diff --git a/ambari-web/app/views/main/views/details.js 
b/ambari-web/app/views/main/views/details.js
index 93c80f9..98184ef 100644
--- a/ambari-web/app/views/main/views/details.js
+++ b/ambari-web/app/views/main/views/details.js
@@ -27,34 +27,6 @@ App.MainViewsDetailsView = Em.View.extend({
   attributeBindings: ['src','seamless'],
   seamless: seamless,
 
-  interval: null,
-
-  /**
-   * Drop autoHeight timer
-   */
-  willDestroyElement: function() {
-var interval = this.get('interval');
-if (interval) {
-  clearInterval(interval);
-}
-  },
-
-  /**
-   * For view's iframe do autoHeight with timer
-   * Timer is dropped when user navigates away
-   */
-  didInsertElement: function() {
-var interval,
-  self = this,
-  timer = function (resizeFunction, iframe) {
-interval = setInterval(function() {
-  resizeFunction(iframe);
-}, 100);
-self.set('interval', interval);
-};
-$('iframe').iframeAutoHeight({triggerFunctions: [timer]});
-  },
-
   src: function() {
 return window.location.origin + this.get('controller.content.href');
   }.property('controller.content')

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f287ce3/ambari-web/vendor/scripts/jquery.iframe-auto-height.plugin.1.9.5.js
--
diff --git 
a/ambari-web/vendor/scripts/jquery.iframe-auto-height.plugin.1.9.5.js 
b/ambari-web/vendor/scripts/jquery.iframe-auto-height.plugin.1.9.5.js
deleted file mode 100644
index 2c8c2d8..000
--- a/ambari-web/vendor/scripts/jquery.iframe-auto-height.plugin.1.9.5.js
+++ /dev/null
@@ -1,224 +0,0 @@
-/*jslint white: true, indent: 2, onevar: false, browser: true, undef: true, 
nomen: false, eqeqeq: true, plusplus: false, bitwise: true, regexp: true, 

git commit: AMBARI-7222. upgrading a cluster to ambari-1.7.0 should create cluster-env file (aonishuk)

2014-09-09 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 16d435dae - 923549bd5


AMBARI-7222. upgrading a cluster to ambari-1.7.0 should create cluster-env file 
 (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/923549bd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/923549bd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/923549bd

Branch: refs/heads/trunk
Commit: 923549bd5cdd008bf0331bdaf46a08cbd34860da
Parents: 16d435d
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Tue Sep 9 20:03:02 2014 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Tue Sep 9 20:03:02 2014 +0300

--
 .../main/java/org/apache/ambari/server/state/ConfigHelper.java| 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/923549bd/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 6d70695..790c177 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -423,6 +423,8 @@ public class ConfigHelper {
 
 for(Service service : 
clusters.getCluster(clusterName).getServices().values()) {
   SetPropertyInfo stackProperties = 
ambariMetaInfo.getProperties(stack.getName(), stack.getVersion(), 
service.getName());
+  SetPropertyInfo stackLevelProperties = 
ambariMetaInfo.getStackProperties(stack.getName(), stack.getVersion());
+  stackProperties.addAll(stackLevelProperties);
   
   for (PropertyInfo stackProperty : stackProperties) {
 if(stackProperty.getName().equals(propertyName)) {
@@ -432,7 +434,6 @@ public class ConfigHelper {
   result.add(configType);
 }
   }
-  
 }
 
 return result;



git commit: AMBARI-6786. Provide testcases for configs got by /recommendations on stack-version

2014-09-09 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk c2a117feb - fbe8b876a


AMBARI-6786. Provide testcases for configs got by /recommendations on 
stack-version


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fbe8b876
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fbe8b876
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fbe8b876

Branch: refs/heads/trunk
Commit: fbe8b876a818fa9ad8215557c407a2f1a6e47412
Parents: c2a117f
Author: Srimanth Gunturi sgunt...@hortonworks.com
Authored: Tue Sep 9 10:42:42 2014 -0700
Committer: Srimanth Gunturi sgunt...@hortonworks.com
Committed: Tue Sep 9 13:22:52 2014 -0700

--
 .../stacks/HDP/1.3.2/services/stack_advisor.py  |  19 ++-
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  37 +++--
 .../stacks/HDP/2.1/services/stack_advisor.py|   8 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   | 157 ++-
 .../stacks/2.1/common/test_stack_advisor.py | 132 
 5 files changed, 323 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fbe8b876/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
index c9b119f..ba42075 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/stack_advisor.py
@@ -19,6 +19,7 @@ limitations under the License.
 
 import re
 import sys
+from math import ceil
 
 from stack_advisor import DefaultStackAdvisor
 
@@ -146,19 +147,21 @@ class HDP132StackAdvisor(DefaultStackAdvisor):
   24  cluster[ram]: 2048
 }[1]
 
+totalAvailableRam = cluster[ram] - cluster[reservedRam]
+if cluster[hBaseInstalled]:
+  totalAvailableRam -= cluster[hbaseRam]
+cluster[totalAvailableRam] = max(2048, totalAvailableRam * 1024)
 '''containers = max(3, min (2*cores,min (1.8*DISKS,(Total available RAM) / 
MIN_CONTAINER_SIZE'''
-cluster[containers] = max(3,
-min(2 * cluster[cpu],
-int(min(1.8 * cluster[disk],
-cluster[ram] / 
cluster[minContainerSize]
+cluster[containers] = round(max(3,
+  min(2 * cluster[cpu],
+  min(ceil(1.8 * cluster[disk]),
+  cluster[totalAvailableRam] / 
cluster[minContainerSize]
 
 '''ramPerContainers = max(2GB, RAM - reservedRam - hBaseRam) / 
containers'''
-cluster[ramPerContainer] = max(2048,
- cluster[ram] - cluster[reservedRam] - 
cluster[hbaseRam])
-cluster[ramPerContainer] /= cluster[containers]
+cluster[ramPerContainer] = abs(cluster[totalAvailableRam] / 
cluster[containers])
 '''If greater than 1GB, value will be in multiples of 512.'''
 if cluster[ramPerContainer]  1024:
-  cluster[ramPerContainer] = ceil(cluster[ramPerContainer] / 512) * 512
+  cluster[ramPerContainer] = int(cluster[ramPerContainer] / 512) * 512
 
 cluster[mapMemory] = int(cluster[ramPerContainer])
 cluster[reduceMemory] = cluster[ramPerContainer]

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbe8b876/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 452ccbd..8853e13 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -19,6 +19,7 @@ limitations under the License.
 
 import re
 import sys
+from math import ceil
 
 from stack_advisor import DefaultStackAdvisor
 
@@ -91,19 +92,19 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 
   def recommendYARNConfigurations(self, configurations, clusterData):
 putYarnProperty = self.putProperty(configurations, yarn-site)
-putYarnProperty('yarn.nodemanager.resource.memory-mb', 
clusterData['containers'] * clusterData['ramPerContainer'])
-putYarnProperty('yarn.scheduler.minimum-allocation-mb', 
clusterData['ramPerContainer'])
-putYarnProperty('yarn.scheduler.maximum-allocation-mb', 
clusterData['containers'] * clusterData['ramPerContainer'])
+putYarnProperty('yarn.nodemanager.resource.memory-mb', 

[1/2] AMBARI-7230. LDAP Sync Scale issues for thousands of users/100's of groups. (mahadev)

2014-09-09 Thread mahadev
Repository: ambari
Updated Branches:
  refs/heads/trunk fbe8b876a - 17b48bf40


http://git-wip-us.apache.org/repos/asf/ambari/blob/17b48bf4/ambari-server/src/main/java/org/apache/ambari/server/security/ldap/LdapUserGroupMemberDto.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/ldap/LdapUserGroupMemberDto.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/ldap/LdapUserGroupMemberDto.java
new file mode 100644
index 000..319b831
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/ldap/LdapUserGroupMemberDto.java
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.security.ldap;
+
+/**
+ * Pojo with information about LDAP membership.
+ */
+public class LdapUserGroupMemberDto {
+  /**
+   * Name of the group.
+   */
+  private final String groupName;
+
+  /**
+   * Name of the user.
+   */
+  private final String userName;
+
+  /**
+   * Constructor.
+   *
+   * @param groupName group name
+   * @param userName user name
+   */
+  public LdapUserGroupMemberDto(String groupName, String userName) {
+this.groupName = groupName;
+this.userName = userName;
+  }
+
+  /**
+   * Get the group name.
+   *
+   * @return the group name
+   */
+  public String getGroupName() {
+return groupName;
+  }
+
+  /**
+   * Get the user name.
+   *
+   * @return the user name
+   */
+  public String getUserName() {
+return userName;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+
+LdapUserGroupMemberDto that = (LdapUserGroupMemberDto) o;
+
+if (userName != null ? !userName.equals(that.userName) : that.userName != 
null) return false;
+if (groupName != null ? !groupName.equals(that.groupName) : that.groupName 
!= null) return false;
+
+return true;
+  }
+
+  @Override
+  public int hashCode() {
+int result = userName != null ? userName.hashCode() : 0;
+result = 31 * result + (groupName != null ? groupName.hashCode() : 0);
+return result;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/17b48bf4/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 81b79d1..35ba17b 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -2940,11 +2940,11 @@ def setup_ldap():
   LDAP_PRIMARY_URL_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[0])
   LDAP_SECONDARY_URL_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[1])
   LDAP_USE_SSL_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[2], false)
-  LDAP_USER_CLASS_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[3], person)
+  LDAP_USER_CLASS_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[3], posixAccount)
   LDAP_USER_ATT_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[4], uid)
-  LDAP_GROUP_CLASS_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[5], groupOfUniqueNames)
+  LDAP_GROUP_CLASS_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[5], posixGroup)
   LDAP_GROUP_ATT_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[6], cn)
-  LDAP_GROUP_MEMBER_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[7], uniqueMember)
+  LDAP_GROUP_MEMBER_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[7], memberUid)
   LDAP_BASE_DN_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[8])
   LDAP_BIND_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_reqd[9], false)
   LDAP_MGR_DN_DEFAULT = get_value_from_properties(properties, 
ldap_property_list_opt[0])


git commit: AMBARI-7232. Admin View: Views API should not allow access to Admin View UI by non-Admin users. (jaimin)

2014-09-09 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 00be663b5 - 3c30d9158


AMBARI-7232. Admin View: Views API should not allow access to Admin View UI by 
non-Admin users. (jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3c30d915
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3c30d915
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3c30d915

Branch: refs/heads/trunk
Commit: 3c30d9158db2902f6fca3856b65d4a98886e23f2
Parents: 00be663
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Tue Sep 9 17:01:59 2014 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Tue Sep 9 17:01:59 2014 -0700

--
 .../ambari/server/api/AmbariPersistFilter.java  |  1 -
 .../server/controller/AmbariHandlerList.java| 43 --
 .../ambari/server/controller/AmbariServer.java  | 26 --
 .../server/controller/ControllerModule.java | 69 +--
 .../controller/FailsafeServletResponse.java | 22 -
 .../server/orm/entities/ViewInstanceEntity.java | 89 
 .../ambari/server/security/SecurityFilter.java  |  2 +-
 .../AmbariAuthorizationFilter.java  | 35 ++--
 .../orm/entities/ViewInstanceEntityTest.java| 16 
 9 files changed, 254 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3c30d915/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariPersistFilter.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariPersistFilter.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariPersistFilter.java
index 971b8a0..a5ab041 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariPersistFilter.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariPersistFilter.java
@@ -19,7 +19,6 @@ package org.apache.ambari.server.api;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
-import com.google.inject.persist.PersistService;
 import com.google.inject.persist.UnitOfWork;
 
 import javax.servlet.*;

http://git-wip-us.apache.org/repos/asf/ambari/blob/3c30d915/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
index 2dc3f47..6a831f8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
@@ -17,6 +17,12 @@
  */
 package org.apache.ambari.server.controller;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
 import org.apache.ambari.server.orm.entities.ViewEntity;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
 import org.apache.ambari.server.view.ViewContextImpl;
@@ -25,12 +31,12 @@ import org.apache.ambari.server.view.ViewRegistry;
 import org.apache.ambari.view.SystemException;
 import org.apache.ambari.view.ViewContext;
 import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.SessionManager;
+import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.webapp.WebAppContext;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import java.util.HashMap;
-import java.util.Map;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.GenericWebApplicationContext;
+import org.springframework.web.filter.DelegatingFilterProxy;
 
 /**
  * An Ambari specific extension of the FailsafeHandlerList that allows for the 
addition
@@ -46,6 +52,15 @@ public class AmbariHandlerList extends FailsafeHandlerList 
implements ViewInstan
   ViewRegistry viewRegistry;
 
   /**
+   * Session manager.
+   */
+  @Inject
+  SessionManager sessionManager;
+
+  @Inject
+  DelegatingFilterProxy springSecurityFilter;
+
+  /**
* The Handler factory.
*/
   private final HandlerFactory handlerFactory;
@@ -55,6 +70,10 @@ public class AmbariHandlerList extends FailsafeHandlerList 
implements ViewInstan
*/
   private final MapViewInstanceEntity, Handler handlerMap = new 
HashMapViewInstanceEntity, Handler();
 
+  /**
+   * Spring web app context.
+   */
+  private GenericWebApplicationContext springWebAppContext;
 
   // - Constructors --
 
@@ -72,6 +91,10 @@ public class AmbariHandlerList extends FailsafeHandlerList 
implements ViewInstan
 

git commit: AMBARI-7234. Admin View: Unclear error during deleting view with set permission for user. (jaimin)

2014-09-09 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 3c30d9158 - e40e47f83


AMBARI-7234. Admin View: Unclear error during deleting view with set permission 
for user. (jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e40e47f8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e40e47f8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e40e47f8

Branch: refs/heads/trunk
Commit: e40e47f8370941cbc0d818150bd7eea6d20a6522
Parents: 3c30d91
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Tue Sep 9 17:11:36 2014 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Tue Sep 9 17:11:36 2014 -0700

--
 .../apache/ambari/server/view/ViewRegistry.java |  4 ++
 .../ambari/server/view/ViewRegistryTest.java| 39 
 2 files changed, 43 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e40e47f8/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index 859ea96..509e474 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -567,6 +567,10 @@ public class ViewRegistry {
   LOG.debug(Deleting view instance  + viewName + / +
   version + / +instanceName);
 }
+ListPrivilegeEntity instancePrivileges = 
privilegeDAO.findByResourceId(instanceEntity.getResource().getId());
+for (PrivilegeEntity privilegeEntity : instancePrivileges) {
+  privilegeDAO.remove(privilegeEntity);
+}
 instanceDAO.remove(instanceEntity);
 viewEntity.removeInstanceDefinition(instanceName);
 removeInstanceDefinition(viewEntity, instanceName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e40e47f8/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
index 7ce4699..38c2f9b 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
@@ -33,10 +33,12 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -703,6 +705,43 @@ public class ViewRegistryTest {
   }
 
   @Test
+  public void testUninstallViewInstance() throws Exception {
+
+ViewRegistry registry = getRegistry();
+
+Configuration ambariConfig = new Configuration(new Properties());
+
+ViewConfig config = ViewConfigTest.getConfig(xml_valid_instance);
+ViewEntity viewEntity = getViewEntity(config, ambariConfig, 
getClass().getClassLoader(), );
+ViewInstanceEntity viewInstanceEntity = getViewInstanceEntity(viewEntity, 
config.getInstances().get(0));
+ResourceEntity resource = new ResourceEntity();
+resource.setId(3L);
+viewInstanceEntity.setResource(resource);
+PrivilegeEntity privilege1 = createNiceMock(PrivilegeEntity.class);
+PrivilegeEntity privilege2 = createNiceMock(PrivilegeEntity.class);
+ListPrivilegeEntity privileges = Arrays.asList(privilege1, privilege2);
+
+expect(privilegeDAO.findByResourceId(3L)).andReturn(privileges);
+privilegeDAO.remove(privilege1);
+privilegeDAO.remove(privilege2);
+viewInstanceDAO.remove(viewInstanceEntity);
+
+handlerList.removeViewInstance(viewInstanceEntity);
+
+replay(viewInstanceDAO, privilegeDAO, handlerList);
+
+registry.addDefinition(viewEntity);
+registry.addInstanceDefinition(viewEntity, viewInstanceEntity);
+registry.uninstallViewInstance(viewInstanceEntity);
+
+CollectionViewInstanceEntity viewInstanceDefinitions = 
registry.getInstanceDefinitions(viewEntity);
+
+Assert.assertEquals(0, viewInstanceDefinitions.size());
+
+verify(viewInstanceDAO, privilegeDAO, handlerList);
+  }
+
+  @Test
   public void testUpdateViewInstance_invalid() throws Exception {
 
 ViewRegistry registry = getRegistry();



git commit: AMBARI-7228. Too much white space in the left half of the Manage Ambari page.(XIWANG)

2014-09-09 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk e40e47f83 - 364417494


AMBARI-7228. Too much white space in the left half of the Manage Ambari 
page.(XIWANG)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/36441749
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/36441749
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/36441749

Branch: refs/heads/trunk
Commit: 364417494428f1b5bad0c8ad1167aee536512b5e
Parents: e40e47f
Author: Xi Wang xiw...@apache.org
Authored: Tue Sep 9 14:52:15 2014 -0700
Committer: Xi Wang xiw...@apache.org
Committed: Tue Sep 9 17:20:44 2014 -0700

--
 .../resources/ui/admin-web/app/styles/main.css  | 30 ++--
 .../ui/admin-web/app/views/leftNavbar.html  |  8 +++---
 2 files changed, 32 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/36441749/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
--
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css 
b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index e1be895..e92fe1a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -229,17 +229,43 @@
 
 .left-navbar .panel{
   border-radius: 0;
+  font-size: 15px;
+}
+.left-navbar .panel-heading {
+  padding: 8px 15px;
+  font-weight: bold;
+}
+.left-navbar .panel-body {
+  padding: 5px 15px;
+}
+.left-navbar .panel-body #cluster-name input{
+  font-size: 17px;
+}
+.left-navbar .panel-body #cluster-name form{
+  margin-top: 4px;
+  margin-bottom: -10px;
+}
+.left-navbar .panel-body h4 .glyphicon{
+  font-size: 14px;
+}
+.left-navbar .panel-body #LDAP-button {
+  padding: 5px;
+}
+.left-navbar .panel-body hr{
+  margin-top: 5px;
+  margin-bottom: 5px;
 }
 .left-navbar .panel-body li{
   margin: 0 -15px;
 }
 .left-navbar .panel-body li a{
   border-radius: 0;
-  padding-left: 30px;
+  padding-left: 33px;
+  padding-top: 8px;
+  padding-bottom: 8px;
 }
 .left-navbar .panel-body li.active a{
   background: #666;
-  
 }
 
 .search-container{

http://git-wip-us.apache.org/repos/asf/ambari/blob/36441749/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
index 272c762..8b57754 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
@@ -20,10 +20,10 @@
 div class=panel-headingspan class=glyphicon glyphicon-cloud/span 
Clusters/div
 div class=panel-body
   div ng-show=cluster
-div ng-switch on=editCluster.editingName
-  h5 ng-switch-when=false{{cluster.Clusters.cluster_name}}
+div id=cluster-name  ng-switch on=editCluster.editingName
+  h4 ng-switch-when=false{{cluster.Clusters.cluster_name}}
 i ng-click=toggleEditName() class=glyphicon glyphicon-edit 
pull-right edit-cluster-name tooltip=Rename Cluster/i
-  /h5
+  /h4
 
   form ng-keyup=toggleEditName($event) tabindex=1 
name=editClusterNameForm class=editClusterNameForm ng-switch-when=true
 ng-submit=editCluster.name !== cluster.Clusters.cluster_name 
 editClusterNameForm.newClusterName.$valid  confirmClusterNameChange()
@@ -89,7 +89,7 @@
 li ng-class={active: isActive('groups.list')}link-to 
route=groups.list class=groupslist-linkGroups/link-to/li
   /ul
   hr
-  div ng-switch=isLDAPConfigured
+  div id=LDAP-button ng-switch=isLDAPConfigured
 a ng-switch-when=true href class=btn btn-primary btn-block 
syncldapbtn ng-click=syncLDAP()
   span class=glyphicon glyphicon-transfer pulldown2/span Sync 
LDAP
 /a



git commit: AMBARI-7235. Admin View: it is difficult and error-prone to be typing users and groups in textarea for membership and permission changes (implement type-ahead for user + group input fields

2014-09-09 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 364417494 - 9cf27bf86


AMBARI-7235. Admin View: it is difficult and error-prone to be typing users and 
groups in textarea for membership and permission changes (implement type-ahead 
for user + group input fields). (yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9cf27bf8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9cf27bf8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9cf27bf8

Branch: refs/heads/trunk
Commit: 9cf27bf86046b0061f30e5c29e16b8b7aa7ab921
Parents: 3644174
Author: Yusaku Sako yus...@hortonworks.com
Authored: Tue Sep 9 18:32:26 2014 -0700
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Tue Sep 9 18:32:43 2014 -0700

--
 .../main/resources/ui/admin-web/app/index.html  |   2 +
 .../resources/ui/admin-web/app/scripts/app.js   |   1 +
 .../controllers/ambariViews/ViewsEditCtrl.js|   8 +
 .../clusters/ClustersManageAccessCtrl.js|   8 +
 .../controllers/groups/GroupsEditCtrl.js|   9 +
 .../scripts/controllers/users/UsersShowCtrl.js  |  13 ++
 .../app/scripts/directives/editableList.js  | 199 +++
 .../ui/admin-web/app/scripts/services/Group.js  |   6 +
 .../ui/admin-web/app/scripts/services/User.js   |   7 +
 .../resources/ui/admin-web/app/styles/main.css  | 182 +
 .../admin-web/app/views/ambariViews/edit.html   |  29 +--
 .../app/views/clusters/manageAccess.html|  31 +--
 .../app/views/directives/editableList.html  |  44 
 .../ui/admin-web/app/views/groups/edit.html |  23 +--
 .../ui/admin-web/app/views/users/show.html  |  22 +-
 .../src/main/resources/ui/admin-web/bower.json  |   3 +-
 16 files changed, 490 insertions(+), 97 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9cf27bf8/ambari-admin/src/main/resources/ui/admin-web/app/index.html
--
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/index.html 
b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
index 2bc520f..e7a8371 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/index.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
@@ -85,6 +85,7 @@
 script src=bower_components/jquery/dist/jquery.js/script
 script src=bower_components/bootstrap/dist/js/bootstrap.js/script
 script src=bower_components/angular/angular.js/script
+script src=bower_components/angular-animate/angular-animate.js/script
 script src=bower_components/angular-route/angular-route.js/script
 script 
src=bower_components/angular-bootstrap/ui-bootstrap-tpls.js/script
 script src=bower_components/lodash/dist/lodash.compat.js/script
@@ -126,6 +127,7 @@
 script src=scripts/directives/linkToDir.js/script
 script src=scripts/directives/PasswordVerify.js/script
 script src=scripts/directives/disabledTooltip.js/script
+script src=scripts/directives/editableList.js/script
 script src=scripts/services/User.js/script
 script src=scripts/services/Group.js/script
 script src=scripts/services/View.js/script

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cf27bf8/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
--
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
index b9fcce2..b580da7 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
@@ -19,6 +19,7 @@
 
 angular.module('ambariAdminConsole', [
   'ngRoute',
+  'ngAnimate',
   'ui.bootstrap',
   'restangular',
   'angularAlert',

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cf27bf8/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
index d860904..4355f63 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
@@ -160,6 +160,14 @@ angular.module('ambariAdminConsole')
 $scope.editPermissionDisabled = true;
   };
 
+  $scope.$watch(function() {
+return $scope.permissionsEdit;
+  }, function(newValue) {
+if(newValue){
+  $scope.savePermissions();
+}
+  }, true);  
+