You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/02/22 13:54:05 UTC

[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4717: Added recursive fetch of child domains for listUsageRecords API call

Spaceman1984 commented on a change in pull request #4717:
URL: https://github.com/apache/cloudstack/pull/4717#discussion_r580265549



##########
File path: server/src/main/java/com/cloud/usage/UsageServiceImpl.java
##########
@@ -248,7 +248,17 @@ public boolean generateUsageRecords(GenerateUsageRecordsCmd cmd) {
             sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
         }
 
-        if (domainId != null) {
+        if (cmd.isRecursive() && domainId != null){

Review comment:
       While testing I found that users cannot call this API, but domain admins can. I have added a check, if an account id is specified, if it belongs to any of the domains for the calling domain admin.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org