CLOUDSTACK-5960: Remove another check preventing Domain admin and

normal user from registering template in S3.
This commit is contained in:
Min Chen 2014-04-14 14:41:50 -07:00
parent fd3a0d739e
commit a636ee4dab
1 changed files with 1 additions and 5 deletions

View File

@ -179,7 +179,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
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.");
throw new InvalidParameterValueException("Please specify a valid zone Id. Only admins can create templates in all zones.");
}
if (url.toLowerCase().contains("file://")) {
@ -209,10 +209,6 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
_resourceLimitMgr.checkResourceLimit(templateOwner, ResourceType.template);
if (!_accountMgr.isRootAdmin(templateOwner.getId()) && zoneId == null) {
throw new IllegalArgumentException("Only admins can create templates in all zones");
}
// If a zoneId is specified, make sure it is valid
if (zoneId != null) {
DataCenterVO zone = _dcDao.findById(zoneId);