Repository: cloudstack
Updated Branches:
  refs/heads/4.5 ac820a323 -> 42f628c61


CLOUDSTACK-7532: Template status is not shown in UI/API response for 
non-default account users. Show it if the owner of the template is the caller


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

Branch: refs/heads/4.5
Commit: 42f628c61c4070f891b16c1a81d2985bcf8b9281
Parents: ac820a3
Author: Nitin Mehta <[email protected]>
Authored: Wed Oct 15 13:47:08 2014 -0700
Committer: Nitin Mehta <[email protected]>
Committed: Wed Oct 15 13:53:39 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42f628c6/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java 
b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
index d3e1253..4e33728 100644
--- a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
@@ -156,8 +156,8 @@ public class TemplateJoinDaoImpl extends 
GenericDaoBase<TemplateJoinVO, Long> im
         templateResponse.setDomainId(template.getDomainUuid());
         templateResponse.setDomainName(template.getDomainName());
 
-        // If the user is an Admin, add the template download status
-        if (view == ResponseView.Full) {
+        // If the user is an 'Admin' or 'the owner of template', add the 
template download status
+        if (view == ResponseView.Full ||  template.getAccountId() == 
CallContext.current().getCallingAccount().getId() ) {
             String templateStatus = getTemplateStatus(template);
             if (templateStatus != null) {
                 templateResponse.setStatus(templateStatus);

Reply via email to