Commit edc87797 authored by Julien Muchembled's avatar Julien Muchembled

Make domain tool do an unrestricted catalog search where getting applicable rules

parent 9e84b6ac
......@@ -57,11 +57,15 @@ class DomainTool(BaseTool):
# XXX FIXME method should not be public
# (some users are not able to see resource's price)
security.declarePublic('searchPredicateList')
def searchPredicateList(self, context, test=1, sort_method=None,
def searchPredicateList(self, *args, **kw):
return self._searchPredicateList(restricted=True, *args, **kw)
def _searchPredicateList(self, context, test=1, sort_method=None,
ignored_category_list=None,
tested_base_category_list=None,
filter_method=None, acquired=1,
strict=True, sort_key_method=None, query=None, **kw):
strict=True, sort_key_method=None, query=None,
restricted=False, **kw):
# XXX: about "strict" parameter: This is a transition parameter,
# allowing someone hitting a bug to revert to original behaviour easily.
# It is not a correct name, as pointed out by Jerome. But instead of
......@@ -231,7 +235,10 @@ class DomainTool(BaseTool):
if query_list:
kw['query'] = ComplexQuery(logical_operator='AND', *query_list)
if restricted:
sql_result_list = portal_catalog.searchResults(**kw)
else:
sql_result_list = portal_catalog.unrestrictedSearchResults(**kw)
if kw.get('src__'):
return sql_result_list
result_list = []
......
......@@ -116,7 +116,7 @@ class RuleTool(BaseTool):
# We don't know why it failed so let searchPredicateList do the work.
rule_uid_list.append(rule.getUid())
return rule_uid_list and portal.portal_domains.searchPredicateList(
return rule_uid_list and portal.portal_domains._searchPredicateList(
context=movement, uid=rule_uid_list,
tested_base_category_list=tested_base_category_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment