Repository: cloudstack Updated Branches: refs/heads/4.4-forward 7309146f9 -> 3af2f6d14
CLOUDSTACK-6513: templateFilter=shared should not show self-owned template. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3af2f6d1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3af2f6d1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3af2f6d1 Branch: refs/heads/4.4-forward Commit: 3af2f6d1418c66533067b5050d2fe3fd4200beb9 Parents: 7309146 Author: Min Chen <min.c...@citrix.com> Authored: Tue Apr 29 19:02:57 2014 -0700 Committer: Min Chen <min.c...@citrix.com> Committed: Tue Apr 29 19:02:57 2014 -0700 ---------------------------------------------------------------------- server/src/com/cloud/api/query/QueryManagerImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3af2f6d1/server/src/com/cloud/api/query/QueryManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 9c31f47..8047ea6 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -3346,10 +3346,11 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sc.addAnd("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); } } else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) { - SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria(); - scc.addOr("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); - scc.addOr("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); - sc.addAnd("accountId", SearchCriteria.Op.SC, scc); + sc.addAnd("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); +// SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria(); +// scc.addOr("accountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); +// scc.addOr("sharedAccountId", SearchCriteria.Op.IN, permittedAccountIds.toArray()); +// sc.addAnd("accountId", SearchCriteria.Op.SC, scc); } else if (templateFilter == TemplateFilter.executable) { SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria(); scc.addOr("publicTemplate", SearchCriteria.Op.EQ, true);