From 3b442acdd7977d09de60dfe61eaf6f148df1af4b Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 15 Oct 2014 13:47:08 -0700 Subject: [PATCH] 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) --- server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java index d3e125341ac..4e33728df20 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);