From 301c4413bc4532d885ee739f8890da11ce3bfebc Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Fri, 25 Jan 2013 14:45:08 +0100 Subject: [PATCH] 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. --- server/src/com/cloud/user/DomainManagerImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java index 54ca2ac44bd..791f58174e2 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; }