Bug 13314 - acton-bet3:vmware/xen:fail to attach "VMware Tools Installer ISO" to instance

Changes:
- 'sameOwner' check cannot be used for ISO's
- So need to make two access checks: See if caller has access to VM and ISO and also check if the VM's owner has access to the ISO.
This commit is contained in:
prachi 2012-01-25 18:17:53 -08:00
parent e6f6437afa
commit 93ff791497
1 changed files with 7 additions and 1 deletions

View File

@ -1132,7 +1132,13 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
}
//check permissions
_accountMgr.checkAccess(caller, null, true, iso, vm);
//check if caller has access to VM and ISO
//and also check if the VM's owner has access to the ISO.
_accountMgr.checkAccess(caller, null, false, iso, vm);
Account vmOwner = _accountDao.findById(vm.getAccountId());
_accountMgr.checkAccess(vmOwner, null, false, iso, vm);
State vmState = vm.getState();
if (vmState != State.Running && vmState != State.Stopped) {