Updated Branches:
  refs/heads/master cf4dba34a -> c8692f2e4

CLOUDSTACK-3245: non admin user not able to register template
Reviewed-by: Alena Prokharchyk


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c8692f2e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c8692f2e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c8692f2e

Branch: refs/heads/master
Commit: c8692f2e4a9760a58dbf457bf128fa484a491d0d
Parents: cf4dba3
Author: Harikrishna Patnala <[email protected]>
Authored: Fri Jun 28 00:11:54 2013 +0530
Committer: Alena Prokharchyk <[email protected]>
Committed: Thu Jun 27 14:09:52 2013 -0700

----------------------------------------------------------------------
 .../api/command/user/template/RegisterTemplateCmd.java           | 2 +-
 server/src/com/cloud/template/TemplateAdapterBase.java           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8692f2e/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
index 13bd5da..c1d3f59 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
@@ -212,7 +212,7 @@ public class RegisterTemplateCmd extends BaseCmd {
     }
 
     public Boolean isRoutingType() {
-        return isRoutingType == null ? false : isRoutingType;
+        return isRoutingType;
     }
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8692f2e/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java 
b/server/src/com/cloud/template/TemplateAdapterBase.java
index 7835680..c5d4a6b 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -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);
 
        }
 

Reply via email to