mirror of https://github.com/apache/cloudstack.git
Added zone check for attach iso (#3755)
This commit is contained in:
parent
2712decf50
commit
100308536c
|
|
@ -1187,6 +1187,12 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
throw new InvalidParameterValueException("Unable to find an ISO with id " + isoId);
|
||||
}
|
||||
|
||||
long dcId = vm.getDataCenterId();
|
||||
VMTemplateZoneVO exists = _tmpltZoneDao.findByZoneTemplate(dcId, isoId);
|
||||
if (null == exists) {
|
||||
throw new InvalidParameterValueException("ISO is not available in the zone the VM is in.");
|
||||
}
|
||||
|
||||
// check permissions
|
||||
// check if caller has access to VM and ISO
|
||||
// and also check if the VM's owner has access to the ISO.
|
||||
|
|
|
|||
Loading…
Reference in New Issue