Updated Branches: refs/heads/master 6358acff5 -> ce60cfee8
CS-16585: cloudstack 3.0 API - listProjects API - throw an API error if account is specified but domain is not. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ce60cfee Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ce60cfee Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ce60cfee Branch: refs/heads/master Commit: ce60cfee85b8ecbb297b1dbf717b46a7d1133efa Parents: 6358acf Author: Jessica Wang <[email protected]> Authored: Mon Oct 29 11:16:46 2012 -0700 Committer: Jessica Wang <[email protected]> Committed: Mon Oct 29 11:19:29 2012 -0700 ---------------------------------------------------------------------- .../src/com/cloud/projects/ProjectManagerImpl.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce60cfee/server/src/com/cloud/projects/ProjectManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/projects/ProjectManagerImpl.java b/server/src/com/cloud/projects/ProjectManagerImpl.java index 4fa520c..dd23009 100755 --- a/server/src/com/cloud/projects/ProjectManagerImpl.java +++ b/server/src/com/cloud/projects/ProjectManagerImpl.java @@ -382,6 +382,12 @@ public class ProjectManagerImpl implements ProjectManager, Manager{ accountId = owner.getId(); } } + else { //domainId == null + if (accountName != null) { + throw new InvalidParameterValueException("could not find account " + accountName + " because domain is not specified", null); + } + + } } else { if (accountName != null && !accountName.equals(caller.getAccountName())) { throw new PermissionDeniedException("Can't list account " + accountName + " projects; unauthorized");
