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 42f628c61c)
This commit is contained in:
Nitin Mehta 2014-10-15 13:47:08 -07:00
parent bd9d57e20c
commit 3b442acdd7
1 changed files with 2 additions and 2 deletions

View File

@ -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);