CLOUDSTACK-6468:IAM - Templates - Admin user is not allowed to edit template and set isExtractable() paramater.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b6617843 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b6617843 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b6617843 Branch: refs/heads/4.4-forward Commit: b6617843d258d9437a17d39e698edba430768f9a Parents: 3f74cb2 Author: Min Chen <[email protected]> Authored: Mon Apr 21 17:52:39 2014 -0700 Committer: Min Chen <[email protected]> Committed: Mon Apr 21 17:53:04 2014 -0700 ---------------------------------------------------------------------- server/src/com/cloud/template/TemplateManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b6617843/server/src/com/cloud/template/TemplateManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index ead841f..ea51af1 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -1254,8 +1254,8 @@ 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 this attribute."); + if (!template.getFormat().equals(ImageFormat.ISO) && !_accountMgr.isRootAdmin(caller.getId())) { + throw new InvalidParameterValueException("Only ROOT admins are allowed to modify isExtractable attribute."); } else { // For Isos normal user can change it, as their are no derivatives. updatedTemplate.setExtractable(isExtractable.booleanValue());
