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 2023/01/18 20:17:48 UTC

[GitHub] [cloudstack] RodrigoDLopez commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

RodrigoDLopez commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1074032097


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3378,6 +3384,63 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         return _srvOfferingJoinDao.searchAndCount(sc, searchFilter);
     }
 
+    /**
+     * Retrieves the API caller. If the projectId or accountName parameters were provided in the API call, consider the account or project as the API caller.
+     * With that, the APIs return will be filtered by the account defined in the API call.
+     * @param originalCaller Account that made the API call
+     * @param projectId projectId provided in API call
+     * @param accountName accountName provided in API call
+     * @param domainId domainId provided in API call
+     * @return Account object
+     */
+    protected Account getCallerAccordingToProjectIdAndAccountNameAndDomainId(Account originalCaller, Long projectId, String accountName, Long domainId) {

Review Comment:
   @weizhouapache 
   Thanks for the hint



-- 
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: commits-unsubscribe@cloudstack.apache.org

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