bernardodemarco commented on code in PR #12758:
URL: https://github.com/apache/cloudstack/pull/12758#discussion_r3436860239


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1577,7 +1700,9 @@ public boolean restoreBackupVolumeAndAttachToVM(final 
String backedUpVolumeUuid,
         validateBackupForZone(backup.getZoneId());
 
         final VMInstanceVO vm = findVmById(vmId);
-        accountManager.checkAccess(CallContext.current().getCallingAccount(), 
null, true, vm);
+        Account callerAccount = CallContext.current().getCallingAccount();
+        accountManager.checkAccess(callerAccount, null, true, vm);
+        validateHostIdParameter(hostId, callerAccount);
 
         if (vm.getBackupOfferingId() != null && 
!BackupEnableAttachDetachVolumes.value()) {
             throw new CloudRuntimeException("The selected Instance has 
backups, cannot restore and attach Volume to the Instance.");

Review Comment:
   Sure, I'll do this later today



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to