Skip to content

Commit a146047

Browse files
committed
Adjust entity owner
1 parent c90b609 commit a146047

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public Pair<List<QuotaSummaryResponse>, Integer> createQuotaSummaryResponse(Quot
198198
Account caller = CallContext.current().getCallingAccount();
199199

200200
if (!accountTypesThatCanListAllQuotaSummaries.contains(caller.getType()) || !cmd.isListAll()) {
201-
return getQuotaSummaryResponse(caller.getAccountId(), null, null, null, cmd);
201+
return getQuotaSummaryResponse(cmd.getEntityOwnerId(), null, null, null, cmd);
202202
}
203203

204204
return getQuotaSummaryResponseWithListAll(cmd, caller);
@@ -268,6 +268,10 @@ protected String getDomainPathByDomainIdForDomainAdmin(Account caller) {
268268
}
269269

270270
protected Pair<List<QuotaSummaryResponse>, Integer> getQuotaSummaryResponse(Long accountId, String accountName, Long domainId, String domainPath, QuotaSummaryCmd cmd) {
271+
if (accountId == -1) {
272+
accountId = CallContext.current().getCallingAccountId();
273+
}
274+
271275
Pair<List<QuotaSummaryVO>, Integer> pairSummaries = quotaSummaryDao.listQuotaSummariesForAccountAndOrDomain(accountId, accountName, domainId, domainPath,
272276
cmd.getAccountStateToShow(), cmd.getStartIndex(), cmd.getPageSizeVal());
273277
List<QuotaSummaryVO> summaries = pairSummaries.first();

0 commit comments

Comments
 (0)