server: fix mysql error when list Shared templates for project (#8020)

This commit is contained in:
Wei Zhou 2023-10-03 10:45:47 +02:00 committed by GitHub
parent 96205a51ef
commit 3d8cc63bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3758,6 +3758,9 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
}
} else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) {
// only show templates shared by others
if (permittedAccounts.isEmpty()) {
return new Pair<>(new ArrayList<>(), 0);
}
sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray());
} else if (templateFilter == TemplateFilter.executable) {
SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();