DaanHoogland commented on a change in pull request #5866:
URL: https://github.com/apache/cloudstack/pull/5866#discussion_r784884868



##########
File path: server/src/main/java/com/cloud/usage/UsageServiceImpl.java
##########
@@ -255,9 +222,7 @@ public boolean generateUsageRecords(GenerateUsageRecordsCmd 
cmd) {
         SearchCriteria<UsageVO> sc = _usageDao.createSearchCriteria();
 
         if (accountId != -1 && accountId != Account.ACCOUNT_ID_SYSTEM && 
!ignoreAccountId) {
-            // account exists and either domain on user role
-            // If not recursive and the account belongs to the user/domain 
admin, or the account was passed in, filter
-            if ((accountId == caller.getId() && !cmd.isRecursive()) || 
cmd.getAccountId() != null){
+            if ((accountId == caller.getId() && !cmd.isRecursive()) || 
cmd.getAccountId() != null || projectRequested){

Review comment:
       It does, @weizhouapache it is a check whether the caller is the one 
asking for their own usage or someone else. Are you saying that it is not a 
valid test in this location? I.E. you are sugesting 
   ```suggestion
               if (!cmd.isRecursive()) || cmd.getAccountId() != null || 
projectRequested){
   ```
   is that right?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to