CLOUDSTACK-6468:IAM - Templates - Admin user is not allowed to edit

template and set isExtractable() paramater.
(cherry picked from commit b6617843d258d9437a17d39e698edba430768f9a)

Signed-off-by: Nitin Mehta <nitin.mehta@citrix.com>
This commit is contained in:
Min Chen 2014-04-21 17:52:39 -07:00 committed by Nitin Mehta
parent f4d2034755
commit cc8fc746df

View File

@ -1263,8 +1263,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());