winterhazel commented on code in PR #12284:
URL: https://github.com/apache/cloudstack/pull/12284#discussion_r2634768861
##########
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:
The value itself is not used,
`com.cloud.user.AccountManagerImpl#buildACLSearchParameters` just checks
whether the ID is null in order to decide whether project resources should be
skipped or not, so no.
https://github.com/apache/cloudstack/blob/eb93f0105e315ab11afed16557c12f46e325ad53/server/src/main/java/com/cloud/user/AccountManagerImpl.java#L3376-L3378
--
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]