Skip to content

Commit ce60cfe

Browse files
author
Jessica Wang
committed
CS-16585: cloudstack 3.0 API - listProjects API - throw an API error if account is specified but domain is not.
1 parent 6358acf commit ce60cfe

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎server/src/com/cloud/projects/ProjectManagerImpl.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ public Pair<List<? extends Project>, Integer> listProjects(Long id, String name,
382382
accountId = owner.getId();
383383
}
384384
}
385+
else { //domainId == null
386+
if (accountName != null) {
387+
throw new InvalidParameterValueException("could not find account " + accountName + " because domain is not specified", null);
388+
}
389+
390+
}
385391
} else {
386392
if (accountName != null && !accountName.equals(caller.getAccountName())) {
387393
throw new PermissionDeniedException("Can't list account " + accountName + " projects; unauthorized");

0 commit comments

Comments
 (0)