fix assignvm template permission check (#8886)

This commit is contained in:
Gabriel Pordeus Santos 2024-06-21 05:58:46 -03:00 committed by GitHub
parent ded7b4dbe5
commit 083ac069ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7223,10 +7223,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (template == null) {
throw new InvalidParameterValueException(String.format("Template for VM: %s cannot be found", vm.getUuid()));
}
if (!template.isPublicTemplate()) {
Account templateOwner = _accountMgr.getAccount(template.getAccountId());
_accountMgr.checkAccess(newAccount, null, true, templateOwner);
}
_accountMgr.checkAccess(newAccount, AccessType.UseEntry, true, template);
// VV 5: check the new account can create vm in the domain
DomainVO domain = _domainDao.findById(cmd.getDomainId());