server: volume disk offering owner checkaccess fix

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
This commit is contained in:
Abhishek Kumar 2019-04-22 14:06:26 +05:30 committed by Abhishek Kumar
parent 490e4ad4a1
commit cf7f1ab54d
1 changed files with 2 additions and 2 deletions

View File

@ -599,7 +599,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
throw new InvalidParameterValueException("This disk offering does not allow custom size");
}
_configMgr.checkDiskOfferingAccess(caller, diskOffering, _dcDao.findById(zoneId));
_configMgr.checkDiskOfferingAccess(owner, diskOffering, _dcDao.findById(zoneId));
if (diskOffering.getDiskSize() > 0) {
size = diskOffering.getDiskSize();
@ -944,7 +944,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
throw new InvalidParameterValueException("There are no tags on the current disk offering. The new disk offering needs to have no tags, as well.");
}
_configMgr.checkDiskOfferingAccess(CallContext.current().getCallingAccount(), newDiskOffering, _dcDao.findById(volume.getDataCenterId()));
_configMgr.checkDiskOfferingAccess(_accountMgr.getActiveAccountById(volume.getAccountId()), newDiskOffering, _dcDao.findById(volume.getDataCenterId()));
if (newDiskOffering.isCustomized()) {
newSize = cmd.getSize();