cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/master to 3b442ac
Date Wed, 15 Oct 2014 20:58:32 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master bd9d57e20 -> 3b442acdd


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
(cherry picked from commit 42f628c61c4070f891b16c1a81d2985bcf8b9281)


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

Branch: refs/heads/master
Commit: 3b442acdd7977d09de60dfe61eaf6f148df1af4b
Parents: bd9d57e
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Wed Oct 15 13:47:08 2014 -0700
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Wed Oct 15 13:58:22 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/3b442acd/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);


Mime
View raw message