You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2016/06/09 14:42:32 UTC

[1/2] ambari git commit: AMBARI-17143. Ambari Admin: incorrect navigation behaviour (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 4c5cf30ee -> 6d97cba03


AMBARI-17143. Ambari Admin: incorrect navigation behaviour (akovalenko)


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

Branch: refs/heads/trunk
Commit: 6d97cba03238509990e840a2709d985525158ab8
Parents: b599d19
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Jun 9 17:19:18 2016 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Jun 9 17:19:29 2016 +0300

----------------------------------------------------------------------
 ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d97cba0/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
index 81b4d28..96bcb4c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
@@ -159,7 +159,7 @@ angular.module('ambariAdminConsole')
       templateUrl: 'views/clusters/manageAccess.html',
       controller: 'ClustersManageAccessCtrl'
     },
-    manageAccess2: {
+    userAccessList: {
       url: '/clusters/:id/userAccessList',
       templateUrl: 'views/clusters/userAccessList.html',
       controller: 'UserAccessListCtrl'


[2/2] ambari git commit: AMBARI-17142. RBAC: Roles show "empty" user after delete (akovalenko)

Posted by ak...@apache.org.
AMBARI-17142. RBAC: Roles show "empty" user after delete (akovalenko)


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

Branch: refs/heads/trunk
Commit: b599d192c12f9fbc57a686bc46228d1ca3aba506
Parents: 4c5cf30
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Jun 9 17:15:11 2016 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Jun 9 17:19:29 2016 +0300

----------------------------------------------------------------------
 .../controllers/clusters/UserAccessListCtrl.js  |  2 +-
 .../scripts/controllers/users/UsersShowCtrl.js  | 26 +++++++++++++++++---
 2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b599d192/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
index 10bb53b..4f00aeb 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/UserAccessListCtrl.js
@@ -142,7 +142,7 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio
     if ($scope.isUserActive) {
       Cluster.getPrivilegesForResource({
           nameFilter : user.user_name,
-          typeFilter : $scope.currentTypeFilter,
+          typeFilter : $scope.currentTypeFilter
       }).then(function(data) {
         var arrayOfPrivileges = data.items[0].privileges;
         var privilegesOfTypeUser = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/b599d192/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
index f93a368..386c499 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('UsersShowCtrl', ['$scope', '$routeParams', 'User', '$modal', '$location', 'ConfirmationModal', 'Alert', 'Auth', 'getDifference', 'Group', '$q', '$translate', function($scope, $routeParams, User, $modal, $location, ConfirmationModal, Alert, Auth, getDifference, Group, $q, $translate) {
+.controller('UsersShowCtrl', ['$scope', '$routeParams', 'Cluster', 'User', '$modal', '$location', 'ConfirmationModal', 'Alert', 'Auth', 'getDifference', 'Group', '$q', '$translate', function($scope, $routeParams, Cluster, User, $modal, $location, ConfirmationModal, Alert, Auth, getDifference, Group, $q, $translate) {
 
   var $t = $translate.instant;
 
@@ -179,8 +179,28 @@ angular.module('ambariAdminConsole')
         instanceName: '"' + $scope.user.user_name + '"'
       })
     ).then(function() {
-      User.delete($scope.user.user_name).then(function() {
-        $location.path('/users');
+      Cluster.getPrivilegesForResource({
+        nameFilter : $scope.user.user_name,
+        typeFilter : {value: 'USER'}
+      }).then(function(data) {
+        var privilegesIds = [];
+        var deleteCallback = function () {
+          User.delete($scope.user.user_name).then(function() {
+            $location.path('/users');
+          });
+        };
+        if (data.items && data.items.length) {
+          angular.forEach(data.items[0].privileges, function(privilege) {
+            privilegesIds.push(privilege.PrivilegeInfo.privilege_id);
+          });
+        }
+        if (privilegesIds.length) {
+          Cluster.deleteMultiplePrivileges($routeParams.id, privilegesIds).then(function() {
+            deleteCallback();
+          });
+        } else {
+          deleteCallback();
+        }
       });
     });
   };