weizhouapache commented on code in PR #12284:
URL: https://github.com/apache/cloudstack/pull/12284#discussion_r2634278344


##########
plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java:
##########
@@ -244,25 +244,49 @@ public ListResponse<VolumeMetricsStatsResponse> 
searchForVolumeMetricsStats(List
         return createVolumeMetricsStatsResponse(volumeList, volumeStatsList);
     }
 
+    /**
+     * Outputs the parameters that should be used for access control in the 
query of a resource to
+     * {@code permittedAccounts} and {@code domainIdRecursiveListProject}.
+     * @param isIdProvided indicates whether any ID was provided to the command
+     */
+    private void buildBaseACLSearchParametersForMetrics(boolean isIdProvided, 
List<Long> permittedAccounts, Ternary<Long, Boolean,
+            Project.ListProjectResourcesCriteria> 
domainIdRecursiveListProject) {
+        Account caller = CallContext.current().getCallingAccount();
+        Account.Type callerType = caller.getType();
+
+        boolean recursive = 
AccountTypesWithRecursiveUsageAccess.contains(callerType);
+        domainIdRecursiveListProject.second(recursive);
+
+        // If no ID was provided, then the listing will skip project resources 
(null); otherwise, project resources should
+        // be listed as well (any long allows this)
+        Long id = isIdProvided ? 1L : null;

Review Comment:
   is there side-effect when id is set to 1L ?



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