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 2020/06/15 08:07:37 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

weizhouapache commented on a change in pull request #4145:
URL: https://github.com/apache/cloudstack/pull/4145#discussion_r439999565



##########
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:
       @davidjumani  it should be isRootAdmin instead of isAdmin
   




----------------------------------------------------------------
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:
users@infra.apache.org