You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2013/06/28 15:28:29 UTC

[5/5] git commit: updated refs/heads/master-6-17-stable to 11a28aa

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

Signed-off-by: Jayapal <ja...@apache.org>


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

Branch: refs/heads/master-6-17-stable
Commit: 11a28aae455ba070a8afa105a51a758a78762f9e
Parents: 98b47ab
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Fri Jun 28 14:41:32 2013 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Fri Jun 28 18:51:02 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11a28aae/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 5c2e274..fd007fe 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
@@ -219,7 +219,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/11a28aae/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 0158917..ef32b6b 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -238,11 +238,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(), cmd.getImageStoreUuid(), cmd.isDynamicallyScalable(),
-                cmd.isRoutingType() ? TemplateType.ROUTING : TemplateType.USER);
+                isRouting ? TemplateType.ROUTING : TemplateType.USER);
 
 	}