CLOUDSTACK-3245: non admin user not able to register template

Reviewed-by: Alena Prokharchyk
This commit is contained in:
Harikrishna Patnala 2013-06-28 00:11:54 +05:30 committed by Alena Prokharchyk
parent cf4dba34a4
commit c8692f2e4a
2 changed files with 3 additions and 3 deletions

View File

@ -212,7 +212,7 @@ public class RegisterTemplateCmd extends BaseCmd {
}
public Boolean isRoutingType() {
return isRoutingType == null ? false : isRoutingType;
return isRoutingType;
}
/////////////////////////////////////////////////////

View File

@ -227,13 +227,13 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId());
_accountMgr.checkAccess(caller, null, true, owner);
boolean isRouting = (cmd.isRoutingType() == null) ? false : cmd.isRoutingType();
return prepare(false, UserContext.current().getCallerUserId(), cmd.getTemplateName(), cmd.getDisplayText(),
cmd.getBits(), cmd.isPasswordEnabled(), cmd.getRequiresHvm(), cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(),
cmd.isExtractable(), cmd.getFormat(), cmd.getOsTypeId(), cmd.getZoneId(), HypervisorType.getType(cmd.getHypervisor()),
cmd.getChecksum(), true, cmd.getTemplateTag(), owner, cmd.getDetails(), cmd.isSshKeyEnabled(), null, cmd.isDynamicallyScalable(),
cmd.isRoutingType() ? TemplateType.ROUTING : TemplateType.USER);
isRouting ? TemplateType.ROUTING : TemplateType.USER);
}