Repository: ambari Updated Branches: refs/heads/branch-dev-patch-upgrade 42b8dcf77 -> 535327d12
AMBARI-19542: Cannot change group/user privileges in list view if the user has VIEW.USER privilege (sangeetar) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5ddbb58e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5ddbb58e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5ddbb58e Branch: refs/heads/branch-dev-patch-upgrade Commit: 5ddbb58ec44795314d3a0e539daf11ace87ae6f9 Parents: 6a81155 Author: Sangeeta Ravindran <sangee...@apache.org> Authored: Wed Jan 25 10:37:21 2017 -0800 Committer: Sangeeta Ravindran <sangee...@apache.org> Committed: Wed Jan 25 10:37:21 2017 -0800 ---------------------------------------------------------------------- .../controllers/clusters/UserAccessListCtrl.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5ddbb58e/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 9869d0b..3737414 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 @@ -148,10 +148,12 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio var privilegesOfTypeUser = []; var privilegesOfTypeGroup = []; for (var i = 0; i < arrayOfPrivileges.length; i++) { - if(arrayOfPrivileges[i].PrivilegeInfo.principal_type === "GROUP"){ - privilegesOfTypeGroup.push(arrayOfPrivileges[i]); - } else { - privilegesOfTypeUser.push(arrayOfPrivileges[i].PrivilegeInfo); + if(arrayOfPrivileges[i].PrivilegeInfo.permission_name != "VIEW.USER") { + if(arrayOfPrivileges[i].PrivilegeInfo.principal_type === "GROUP"){ + privilegesOfTypeGroup.push(arrayOfPrivileges[i]); + } else { + privilegesOfTypeUser.push(arrayOfPrivileges[i].PrivilegeInfo); + } } } @@ -204,8 +206,10 @@ function($scope, $location, Cluster, $modal, $rootScope, $routeParams, Permissio user.editable = (Cluster.ineditableRoles.indexOf(privilege.permission_name) === -1); arrayOfPrivileges.forEach(function(privilegeOfTypeGroup) { - if (privilegeOfTypeGroup.PrivilegeInfo.principal_type === "GROUP") { - privilegesOfTypeGroup.push(privilegeOfTypeGroup.PrivilegeInfo); + if(privilegeOfTypeGroup.PrivilegeInfo.permission_name != "VIEW.USER") { + if (privilegeOfTypeGroup.PrivilegeInfo.principal_type === "GROUP") { + privilegesOfTypeGroup.push(privilegeOfTypeGroup.PrivilegeInfo); + } } });