Skip to content

Commit db9aee4

Browse files
committed
CLOUDSTACK-6513: templateFilter=shared should not show self-owned
template.
1 parent a9072a6 commit db9aee4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

server/src/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,10 +3346,11 @@ private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long temp
33463346
sc.addAnd("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
33473347
}
33483348
} else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) {
3349-
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();
3350-
scc.addOr("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
3351-
scc.addOr("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
3352-
sc.addAnd("accountId", SearchCriteria.Op.SC, scc);
3349+
sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
3350+
// SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();
3351+
// scc.addOr("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
3352+
// scc.addOr("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
3353+
// sc.addAnd("accountId", SearchCriteria.Op.SC, scc);
33533354
} else if (templateFilter == TemplateFilter.executable) {
33543355
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();
33553356
scc.addOr("publicTemplate", SearchCriteria.Op.EQ, true);

0 commit comments

Comments
 (0)