Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D0A617A8E for ; Wed, 15 Oct 2014 20:58:32 +0000 (UTC) Received: (qmail 49994 invoked by uid 500); 15 Oct 2014 20:58:32 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 49962 invoked by uid 500); 15 Oct 2014 20:58:32 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 49953 invoked by uid 99); 15 Oct 2014 20:58:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Oct 2014 20:58:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1CCEE98177D; Wed, 15 Oct 2014 20:58:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nitin@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 3b442ac Date: Wed, 15 Oct 2014 20:58:32 +0000 (UTC) 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 Authored: Wed Oct 15 13:47:08 2014 -0700 Committer: Nitin Mehta 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 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);