CLOUDSTACK-4988: when listTemplates call is executed by regular user, but templateFilter=community is passed in, return public templates of subdomains

This commit is contained in:
Alena Prokharchyk 2013-10-29 10:30:30 -07:00
parent 375a59d2f7
commit e5c0de6a2d
1 changed files with 2 additions and 1 deletions

View File

@ -2827,7 +2827,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
}
// get all child domain ID's
if (_accountMgr.isAdmin(account.getType())) {
if (_accountMgr.isAdmin(account.getType())
|| (templateFilter == TemplateFilter.featured || templateFilter == TemplateFilter.community)) {
List<DomainVO> allChildDomains = _domainDao.findAllChildren(accountDomain.getPath(),
accountDomain.getId());
for (DomainVO childDomain : allChildDomains) {