From e309a91a9b2f439cf9c35b9dcbd79889f4a72504 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Mon, 22 Apr 2013 14:19:38 +0530 Subject: [PATCH] CLOUDSTACK-1941:Cannot delete users in the default admin account within the UI --- ui/scripts/accounts.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 8353d70536e..7e82c0fc163 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");