Updated Branches: refs/heads/master 987941a5b -> e309a91a9
CLOUDSTACK-1941:Cannot delete users in the default admin account within the UI Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e309a91a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e309a91a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e309a91a Branch: refs/heads/master Commit: e309a91a9b2f439cf9c35b9dcbd79889f4a72504 Parents: 987941a Author: Pranav Saxena <[email protected]> Authored: Mon Apr 22 14:19:38 2013 +0530 Committer: Pranav Saxena <[email protected]> Committed: Mon Apr 22 14:19:38 2013 +0530 ---------------------------------------------------------------------- ui/scripts/accounts.js | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e309a91a/ui/scripts/accounts.js ---------------------------------------------------------------------- diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 8353d70..7e82c0f 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1372,6 +1372,9 @@ if (jsonObj.state == 'Destroyed') return []; + if( isAdmin() && jsonObj.isdefault == false) + allowedActions.push("remove"); + if(isAdmin()) { allowedActions.push("edit"); //updating networkdomain is allowed on any account, including system-generated default admin account if(!(jsonObj.domain == "ROOT" && jsonObj.name == "admin" && jsonObj.accounttype == 1)) { //if not system-generated default admin account @@ -1393,6 +1396,10 @@ var userActionfilter = function(args) { var jsonObj = args.context.item; var allowedActions = []; + + if( isAdmin() && jsonObj.isdefault == false) + allowedActions.push("remove"); + if(isAdmin()) { allowedActions.push("edit"); allowedActions.push("changePassword");
