Updated Branches:
  refs/heads/4.3 895e581e7 -> e52b457d0

CLOUDSTACK-4505: allow domain admin to expunge a destroyed VM
(cherry picked from commit 8b237eb0a2360ba8aaba798a8febab8ceb5477cb)


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

Branch: refs/heads/4.3
Commit: e52b457d061cdcb25df88e6cb98a6b7ce22778fa
Parents: 895e581
Author: Wei Zhou <[email protected]>
Authored: Tue Nov 26 15:02:44 2013 +0100
Committer: Wei Zhou <[email protected]>
Committed: Tue Nov 26 15:05:09 2013 +0100

----------------------------------------------------------------------
 client/tomcatconf/commands.properties.in | 2 +-
 ui/scripts/instances.js                  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e52b457d/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in 
b/client/tomcatconf/commands.properties.in
index cb9dcf0..28490a9 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -71,7 +71,7 @@ assignVirtualMachine=7
 migrateVirtualMachine=1
 migrateVirtualMachineWithVolume=1
 recoverVirtualMachine=7
-expungeVirtualMachine=1
+expungeVirtualMachine=7
 
 #### snapshot commands
 createSnapshot=15

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e52b457d/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 71c5a32..06acc16 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1765,7 +1765,7 @@
                                     else if (isAdmin()) 
                                         jsonObj = 
$.extend(args.context.instances[0], {
                                             state: "Expunged"
-                                        }); //after root admin expunge a VM, 
listVirtualMachines API will no longer returns this expunged VM to all users.
+                                        }); //after root/domain admin expunge 
a VM, listVirtualMachines API will no longer returns this expunged VM to all 
users.
                                     else
                                         jsonObj = 
$.extend(args.context.instances[0], {
                                             state: "Destroyed"
@@ -2101,7 +2101,7 @@
             if (isAdmin() || isDomainAdmin()) {
                 allowedActions.push("restore");
             }
-            if (isAdmin())
+            if (isAdmin() || isDomainAdmin())
                 allowedActions.push("expunge");
         } else if (jsonObj.state == 'Running') {
             allowedActions.push("stop");
@@ -2161,7 +2161,7 @@
         } else if (jsonObj.state == 'Error') {
             allowedActions.push("destroy");
         } else if (jsonObj.state == 'Expunging') {
-            if (isAdmin())
+            if (isAdmin() || isDomainAdmin())
                 allowedActions.push("expunge");
         }
         return allowedActions;

Reply via email to