Skip to content

Commit 1dcfbbf

Browse files
author
Julien Hervot de Mattos Vaz
committed
Fix QuotaSummaryCmd
1 parent 87feb02 commit 1dcfbbf

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaSummaryCmd.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.apache.cloudstack.quota.QuotaAccountStateFilter;
3232
import org.apache.cloudstack.quota.QuotaService;
3333
import org.apache.commons.lang3.BooleanUtils;
34+
import org.apache.commons.lang3.ObjectUtils;
3435
import org.apache.commons.lang3.StringUtils;
3536

3637

@@ -64,17 +65,9 @@ public class QuotaSummaryCmd extends BaseListCmd {
6465

6566
@Override
6667
public void execute() {
67-
Account caller = CallContext.current().getCallingAccount();
6868
Pair<List<QuotaSummaryResponse>, Integer> responses = quotaResponseBuilder.createQuotaSummaryResponse(this);
69-
if (caller.getType() == Account.Type.ADMIN) {
70-
if (getAccountName() != null && getDomainId() != null)
71-
responses = quotaResponseBuilder.createQuotaSummaryResponse(getAccountName(), getDomainId());
72-
else
73-
responses = quotaResponseBuilder.createQuotaSummaryResponse(isListAll(), getKeyword(), getStartIndex(), getPageSizeVal());
74-
} else {
75-
responses = quotaResponseBuilder.createQuotaSummaryResponse(caller.getAccountName(), caller.getDomainId());
76-
}
77-
final ListResponse<QuotaSummaryResponse> response = new ListResponse<QuotaSummaryResponse>();
69+
ListResponse<QuotaSummaryResponse> response = new ListResponse<>();
70+
7871
response.setResponses(responses.first(), responses.second());
7972
response.setResponseName(getCommandName());
8073
setResponseObject(response);

0 commit comments

Comments
 (0)