CS-16585: cloudstack 3.0 API - listProjects API - throw an API error if account is specified but domain is not.

This commit is contained in:
Jessica Wang 2012-10-29 11:16:46 -07:00
parent 6358acff54
commit ce60cfee85

View File

@ -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");