You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2013/01/30 16:16:25 UTC

git commit: CLOUDSTACK-1054: When calling listDomains through the API do not restrict ADMIN users

Updated Branches:
  refs/heads/master 1906f480d -> 301c4413b


CLOUDSTACK-1054: When calling listDomains through the API do not restrict ADMIN users

When an admin calls this command without the ID parameter do not set the domain's ID
to the ID where the admin is in, this prevents him from doing lookups.


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

Branch: refs/heads/master
Commit: 301c4413bc4532d885ee739f8890da11ce3bfebc
Parents: 1906f48
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Fri Jan 25 14:45:08 2013 +0100
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Wed Jan 30 15:48:01 2013 +0100

----------------------------------------------------------------------
 server/src/com/cloud/user/DomainManagerImpl.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/301c4413/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index 54ca2ac..791f581 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -368,7 +368,9 @@ public class DomainManagerImpl implements DomainManager, DomainService, Manager
             }
             _accountMgr.checkAccess(caller, domain);
         } else {
-            domainId = caller.getDomainId();
+            if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
+                domainId = caller.getDomainId();
+            }
             if (listAll) {
                 isRecursive = true;
             }