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 4F2B217756 for ; Thu, 16 Oct 2014 13:25:57 +0000 (UTC) Received: (qmail 66148 invoked by uid 500); 16 Oct 2014 13:25:35 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 66090 invoked by uid 500); 16 Oct 2014 13:25:35 -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 65574 invoked by uid 99); 16 Oct 2014 13:25:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Oct 2014 13:25:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D5D219ADF50; Thu, 16 Oct 2014 13:25:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Date: Thu, 16 Oct 2014 13:26:13 -0000 Message-Id: <4de430e8627c45faaf86bfb958297967@git.apache.org> In-Reply-To: <613e1faf1a374433b2613446fb63a1e7@git.apache.org> References: <613e1faf1a374433b2613446fb63a1e7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [41/50] [abbrv] git commit: updated refs/heads/master to 7072d8d 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/master Commit: 42f628c61c4070f891b16c1a81d2985bcf8b9281 Parents: ac820a3 Author: Nitin Mehta Authored: Wed Oct 15 13:47:08 2014 -0700 Committer: Nitin Mehta 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 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);