Commit df5b0cb0 authored by Romain Courteaud's avatar Romain Courteaud

Prevent to check worklist guard when filling worklist cache, as this action

required all permissions.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27265 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6d3025f5
......@@ -206,7 +206,8 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
DCWorkflowDefinition.listGlobalActions = DCWorkflowDefinition_listGlobalActions
from Products.ERP5Type.patches.WorkflowTool import SECURITY_PARAMETER_ID, WORKLIST_METADATA_KEY
def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info):
def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info,
check_guard=True):
"""
Return a dict which has an entry per worklist definition
(worklist id as key) and which value is a dict composed of
......@@ -247,7 +248,8 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info):
is_permitted_worklist = 0
if guard is None:
is_permitted_worklist = 1
elif Guard_checkWithoutRoles(guard, security_manager, self, portal):
elif (not check_guard) or \
Guard_checkWithoutRoles(guard, security_manager, self, portal):
is_permitted_worklist = 1
variable_match[SECURITY_PARAMETER_ID] = guard.roles
......
......@@ -585,7 +585,7 @@ def WorkflowTool_refreshWorklistCache(self):
for wf_id in wf_ids:
wf = self.getWorkflowById(wf_id)
if wf is not None:
a = wf.getWorklistVariableMatchDict(info)
a = wf.getWorklistVariableMatchDict(info, check_guard=False)
if a is not None:
worklist_dict[wf_id] = a
# End of duplicated code
......
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