Skip to content

Commit 42f628c

Browse files
committed
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
1 parent ac820a3 commit 42f628c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ public TemplateResponse newTemplateResponse(ResponseView view, TemplateJoinVO te
156156
templateResponse.setDomainId(template.getDomainUuid());
157157
templateResponse.setDomainName(template.getDomainName());
158158

159-
// If the user is an Admin, add the template download status
160-
if (view == ResponseView.Full) {
159+
// If the user is an 'Admin' or 'the owner of template', add the template download status
160+
if (view == ResponseView.Full || template.getAccountId() == CallContext.current().getCallingAccount().getId() ) {
161161
String templateStatus = getTemplateStatus(template);
162162
if (templateStatus != null) {
163163
templateResponse.setStatus(templateStatus);

0 commit comments

Comments
 (0)