mirror of https://github.com/apache/cloudstack.git
bug 9791: check if user is authorized to use a private template for vm creation
status 9791: resolved fixed
This commit is contained in:
parent
84d62553e8
commit
71d0ea4e22
|
|
@ -2184,6 +2184,12 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
throw new InvalidParameterValueException("Installing from ISO requires an ISO that is bootable: " + template.getId());
|
||||
}
|
||||
|
||||
// Check templates permissions
|
||||
if (!template.isPublicTemplate()) {
|
||||
Account templateOwner = _accountMgr.getAccount(template.getAccountId());
|
||||
_accountMgr.checkAccess(owner, templateOwner);
|
||||
}
|
||||
|
||||
// If the template represents an ISO, a disk offering must be passed in, and will be used to create the root disk
|
||||
// Else, a disk offering is optional, and if present will be used to create the data disk
|
||||
Pair<DiskOfferingVO, Long> rootDiskOffering = new Pair<DiskOfferingVO, Long>(null, null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue