mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6436: listResourceDetails - don't return entries set with display=false, by default
Conflicts: api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
This commit is contained in:
parent
a7e267b416
commit
1e0d6716ca
|
|
@ -99,11 +99,10 @@ public class ListNicsCmd extends BaseListCmd {
|
|||
|
||||
|
||||
public Boolean getDisplay() {
|
||||
Account caller = CallContext.current().getCallingAccount();
|
||||
if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
|
||||
return true;
|
||||
if (display != null) {
|
||||
return display;
|
||||
}
|
||||
return display;
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.user.volume;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
|
||||
|
|
@ -26,7 +27,6 @@ import org.apache.cloudstack.api.Parameter;
|
|||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceDetailResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
|
||||
import com.cloud.server.ResourceTag;
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
|
|||
private String key;
|
||||
|
||||
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "if set to true, only details marked with display=true, are returned."
|
||||
+ " Always false is the call is made by the regular user", since = "4.3")
|
||||
+ " False by default", since = "4.3", authorized = { RoleType.Admin })
|
||||
private Boolean forDisplay;
|
||||
|
||||
public String getResourceId() {
|
||||
|
|
@ -61,12 +61,12 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
|
|||
return s_name;
|
||||
}
|
||||
|
||||
public Boolean forDisplay() {
|
||||
if (!_accountService.isAdmin(CallContext.current().getCallingAccount().getType())) {
|
||||
return true;
|
||||
@Override
|
||||
public Boolean getDisplay() {
|
||||
if (forDisplay != null) {
|
||||
return forDisplay;
|
||||
}
|
||||
|
||||
return forDisplay;
|
||||
return super.getDisplay();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -3321,7 +3321,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
@Override
|
||||
public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd) {
|
||||
String key = cmd.getKey();
|
||||
Boolean forDisplay = cmd.forDisplay();
|
||||
Boolean forDisplay = cmd.getDisplay();
|
||||
ResourceTag.ResourceObjectType resourceType = cmd.getResourceType();
|
||||
String resourceIdStr = cmd.getResourceId();
|
||||
Long resourceId = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue