mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-3101:
fix listVolumes to not display volumes to the normal users with forDisplay=false. But display volumes to ROOT Admin irrespective of the flag. Signed off by : nitin mehta<nitin.mehta@citrix.com>
This commit is contained in:
parent
16b022b1b1
commit
f8976a41ce
|
|
@ -35,7 +35,7 @@ import com.cloud.storage.Volume;
|
|||
@APICommand(name = "updateVolume", description="Updates the volume.", responseObject=VolumeResponse.class)
|
||||
public class UpdateVolumeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName());
|
||||
private static final String s_name = "addVolumeresponse";
|
||||
private static final String s_name = "updatevolumeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
|
|
|
|||
|
|
@ -1630,6 +1630,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
String keyword = cmd.getKeyword();
|
||||
String type = cmd.getType();
|
||||
Map<String, String> tags = cmd.getTags();
|
||||
boolean isRootAdmin = _accountMgr.isRootAdmin(caller.getType());
|
||||
|
||||
Long zoneId = cmd.getZoneId();
|
||||
Long podId = null;
|
||||
|
|
@ -1671,6 +1672,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
// display UserVM volumes only
|
||||
sb.and().op("type", sb.entity().getVmType(), SearchCriteria.Op.NIN);
|
||||
sb.or("nulltype", sb.entity().getVmType(), SearchCriteria.Op.NULL);
|
||||
if(!isRootAdmin){
|
||||
sb.and("displayVolume", sb.entity().isDisplayVolume(), SearchCriteria.Op.EQ);
|
||||
}
|
||||
sb.cp();
|
||||
|
||||
|
||||
|
|
@ -1721,6 +1725,10 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
|
|||
sc.setParameters("podId", podId);
|
||||
}
|
||||
|
||||
if(!isRootAdmin){
|
||||
sc.setParameters("displayVolume", 1);
|
||||
}
|
||||
|
||||
// Don't return DomR and ConsoleProxy volumes
|
||||
sc.setParameters("type", VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm,
|
||||
VirtualMachine.Type.DomainRouter);
|
||||
|
|
|
|||
Loading…
Reference in New Issue