Skip to content

Commit 083ac06

Browse files
authored
fix assignvm template permission check (#8886)
1 parent ded7b4d commit 083ac06

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7223,10 +7223,7 @@ public UserVm moveVMToUser(final AssignVMCmd cmd) throws ResourceAllocationExcep
72237223
if (template == null) {
72247224
throw new InvalidParameterValueException(String.format("Template for VM: %s cannot be found", vm.getUuid()));
72257225
}
7226-
if (!template.isPublicTemplate()) {
7227-
Account templateOwner = _accountMgr.getAccount(template.getAccountId());
7228-
_accountMgr.checkAccess(newAccount, null, true, templateOwner);
7229-
}
7226+
_accountMgr.checkAccess(newAccount, AccessType.UseEntry, true, template);
72307227

72317228
// VV 5: check the new account can create vm in the domain
72327229
DomainVO domain = _domainDao.findById(cmd.getDomainId());

0 commit comments

Comments
 (0)