CLOUDSTACK-109: cloudstack UI - (1) account page: fix a bug that 
system-generated default admin account wrongly had enalbe/disable/lock/remove 
option. (2) user page - fix a bug that system-generated default admin account 
user wrongly had enable/disable/remove option.


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

Branch: refs/heads/4.0
Commit: dcb3301be7088e7e4253f04b9c222d91c56ba03b
Parents: fbc82cc
Author: Jessica Wang <[email protected]>
Authored: Mon Sep 24 15:23:51 2012 -0700
Committer: Edison Su <[email protected]>
Committed: Tue Sep 25 15:02:55 2012 -0700

----------------------------------------------------------------------
 ui/scripts/accounts.js |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dcb3301b/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 34a9538..03ec799 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -19,12 +19,6 @@
        var domainObjs;
        var rootDomainId;
 
-  var systemAccountId = 1;
-  var adminAccountId = 2;
-
-  var systemUserId = 1;
-  var adminUserId = 2;
-
   cloudStack.sections.accounts = {
     title: 'label.accounts',
     id: 'accounts',
@@ -1097,7 +1091,7 @@
     if (jsonObj.state == 'Destroyed') return [];
 
     if(isAdmin()) {
-      if(jsonObj.id != systemAccountId && jsonObj.id != adminAccountId) {
+      if(!(jsonObj.domain == "ROOT" && jsonObj.name == "admin" && 
jsonObj.accounttype == 1)) { //if not system-generated default admin account 
         //allowedActions.push("edit");
         if (jsonObj.accounttype == roleTypeUser || jsonObj.accounttype == 
roleTypeDomainAdmin) {
           //allowedActions.push("updateResourceLimits");
@@ -1127,7 +1121,7 @@
       allowedActions.push("edit");
       allowedActions.push("changePassword");
       allowedActions.push("generateKeys");
-      if(jsonObj.id != systemUserId && jsonObj.id != adminUserId) {
+      if(!(jsonObj.domain == "ROOT" && jsonObj.account == "admin" && 
jsonObj.accounttype == 1)) { //if not system-generated default admin account 
user 
         if(jsonObj.state == "enabled")
           allowedActions.push("disable");
         if(jsonObj.state == "disabled")

Reply via email to