davidjumani commented on a change in pull request #4145: URL: https://github.com/apache/cloudstack/pull/4145#discussion_r440052548
########## File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java ########## @@ -781,7 +781,8 @@ Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd); ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>(); ResponseView respView = ResponseView.Restricted; - if (cmd instanceof ListVMsCmdByAdmin) { + Account caller = CallContext.current().getCallingAccount(); + if (_accountMgr.isAdmin(caller.getId())) { Review comment: @weizhouapache Does it detect ListVMsCmd as ListVMsCmdByAdmin for a regular 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: us...@infra.apache.org