mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.14'
This commit is contained in:
commit
5f695c910d
@ -18,7 +18,7 @@
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.api.command.admin.vm.ListVMsCmdByAdmin;
|
||||
import org.apache.cloudstack.api.command.user.vm.ListVMsCmd;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.cloudstack.metrics.MetricsService;
|
||||
@ -30,7 +30,7 @@ import java.util.List;
|
||||
@APICommand(name = ListVMsMetricsCmd.APINAME, description = "Lists VM metrics", responseObject = VmMetricsResponse.class,
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, responseView = ResponseObject.ResponseView.Full,
|
||||
since = "4.9.3", authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
|
||||
public class ListVMsMetricsCmd extends ListVMsCmdByAdmin {
|
||||
public class ListVMsMetricsCmd extends ListVMsCmd {
|
||||
public static final String APINAME = "listVirtualMachinesMetrics";
|
||||
|
||||
@Inject
|
||||
|
||||
@ -837,7 +837,8 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
|
||||
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.isRootAdmin(caller.getId())) {
|
||||
respView = ResponseView.Full;
|
||||
}
|
||||
List<UserVmResponse> vmResponses = ViewResponseHelper.createUserVmResponse(respView, "virtualmachine", cmd.getDetails(), result.first().toArray(new UserVmJoinVO[result.first().size()]));
|
||||
@ -1768,7 +1769,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
|
||||
|
||||
ResponseView respView = cmd.getResponseView();
|
||||
Account account = CallContext.current().getCallingAccount();
|
||||
if (_accountMgr.isAdmin(account.getAccountId())) {
|
||||
if (_accountMgr.isRootAdmin(account.getAccountId())) {
|
||||
respView = ResponseView.Full;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user