mirror of
https://github.com/apache/cloudstack
synced 2026-08-28 00:29:39 +00:00
CLOUDSTACK-5960: Domain admin or user cannot register a template using
S3/Swift object store.
This commit is contained in:
parent
3fae917ebe
commit
6d1475182c
@ -162,8 +162,14 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
|
||||
}
|
||||
|
||||
boolean isAdmin = _accountDao.findById(templateOwner.getId()).getType() == Account.ACCOUNT_TYPE_ADMIN;
|
||||
|
||||
if (!isAdmin && zoneId == null) {
|
||||
boolean isRegionStore = false;
|
||||
List<ImageStoreVO> stores = _imgStoreDao.findRegionImageStores();
|
||||
if (stores != null && stores.size() > 0) {
|
||||
isRegionStore = true;
|
||||
}
|
||||
|
||||
if (!isAdmin && zoneId == null && !isRegionStore ) {
|
||||
// domain admin and user should also be able to register template on a region store
|
||||
throw new InvalidParameterValueException("Please specify a valid zone Id.");
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user