cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.4-forward to 3d1bbeb
Date Tue, 27 May 2014 22:45:02 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 18c6ae079 -> 3d1bbeb26


CLOUDSTACK-6789: UI > User page > fix a bug that a domain-admin was unable to delete
other domain-admin in the same domain.


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

Branch: refs/heads/4.4-forward
Commit: 3d1bbeb262cad98d1b591b42ff5f0e2103dcb1b4
Parents: 18c6ae0
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue May 27 15:44:20 2014 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue May 27 15:44:20 2014 -0700

----------------------------------------------------------------------
 ui/scripts/accounts.js        | 24 +++++++++++++-----------
 ui/scripts/sharedFunctions.js | 12 ------------
 2 files changed, 13 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d1bbeb2/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 4eaa401..2ebfe82 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -1527,19 +1527,21 @@
                     allowedActions.push("enable");
                 allowedActions.push("remove");
             }
-        } else {
-            if (isSelfOrChildDomainUser(jsonObj.username, jsonObj.accounttype, jsonObj.domainid,
jsonObj.iscallerchilddomain)) {
-                if (isDomainAdmin() && jsonObj.username != g_username) {
-                    allowedActions.push("edit");
-                    if (jsonObj.state == "enabled")
-                        allowedActions.push("disable");
-                    if (jsonObj.state == "disabled")
-                        allowedActions.push("enable");
-                    allowedActions.push("remove");
-                }
+        } else { //domain-admin, regular-user
+        	if (jsonObj.username == g_username) { //selected user is self
+        		allowedActions.push("changePassword");
+                allowedActions.push("generateKeys");
+        	} else if (isDomainAdmin()) { //if selected user is not self, and the current login
is domain-admin
+        		allowedActions.push("edit");
+                if (jsonObj.state == "enabled")
+                    allowedActions.push("disable");
+                if (jsonObj.state == "disabled")
+                    allowedActions.push("enable");
+                allowedActions.push("remove");
+                
                 allowedActions.push("changePassword");
                 allowedActions.push("generateKeys");
-            }
+        	}        	
         }
         return allowedActions;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d1bbeb2/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 9cb48a2..d206349 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -765,18 +765,6 @@ var addGuestNetworkDialog = {
         return (g_role == 0);
     }
 
-    function isSelfOrChildDomainUser(username, useraccounttype, userdomainid, iscallerchilddomain)
{
-        if (username == g_username) { //is self
-            return true;
-        } else if (isDomainAdmin() && !iscallerchilddomain && (useraccounttype
== 0)) { //domain admin to user
-            return true;
-        } else if (isDomainAdmin() && iscallerchilddomain && (userdomainid
!= g_domainid)) { //domain admin to subdomain admin and user
-            return true;
-        } else {
-            return false;
-        }
-    }
-
     // FUNCTION: Handles AJAX error callbacks.  You can pass in an optional function to
     // handle errors that are not already handled by this method.
 


Mime
View raw message