diff --git a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java index 5eb96aac11d..373735ce201 100755 --- a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java @@ -1523,9 +1523,9 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager, } if (isExtractable != null) { - // Only Root admins allowed to change it for templates - if (!template.getFormat().equals(ImageFormat.ISO) && !_accountMgr.isRootAdmin(caller.getId())) { - throw new InvalidParameterValueException("Only ROOT admins are allowed to modify isExtractable attribute."); + // Only Root admins and owners are allowed to change it for templates + if (!template.getFormat().equals(ImageFormat.ISO) && caller.getId() != ownerId && !isAdmin) { + throw new InvalidParameterValueException("Only ROOT admins and template owners are allowed to modify isExtractable attribute."); } else { // For Isos normal user can change it, as their are no derivatives. updatedTemplate.setExtractable(isExtractable.booleanValue()); diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index df040001edc..c64efc973d8 100755 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1595,12 +1595,7 @@ isextractable: { label: 'label.extractable.lower', isBoolean: true, - isEditable: function() { - if (isAdmin()) - return true; - else - return false; - }, + isEditable: true, converter: cloudStack.converters.toBooleanText }, passwordenabled: { @@ -2039,12 +2034,7 @@ isextractable: { label: 'label.extractable.lower', isBoolean: true, - isEditable: function() { - if (isAdmin()) - return true; - else - return false; - }, + isEditable: true, converter: cloudStack.converters.toBooleanText }, passwordenabled: { @@ -3327,12 +3317,7 @@ isextractable: { label: 'label.extractable.lower', isBoolean: true, - isEditable: function() { - if (isAdmin()) - return true; - else - return false; - }, + isEditable: true, converter: cloudStack.converters.toBooleanText }, bootable: { @@ -3449,7 +3434,9 @@ || (jsonObj.isready == false) || jsonObj.templatetype == "SYSTEM") { //do nothing } else { - allowedActions.push("downloadTemplate"); + if (jsonObj.isextractable){ + allowedActions.push("downloadTemplate"); + } } // "Delete Template"