Commit c3b7cc4a authored by Romain Courteaud's avatar Romain Courteaud

Use Guard_checkWithoutRoles to check guard expression.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18426 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4621c746
......@@ -240,8 +240,15 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info):
if action_box_name:
variable_match = dict([(x, [y % info for y in worklist_definition.getVarMatch(x)]) for x in worklist_definition.getVarMatchKeys()])
variable_match.setdefault('portal_type', portal_type_list)
if not (guard is None or guard.check(security_manager, self, portal)):
is_permitted_worklist = 0
if guard is None:
is_permitted_worklist = 1
elif Guard_checkWithoutRoles(guard, security_manager, self, portal):
is_permitted_worklist = 1
variable_match[SECURITY_PARAMETER_ID] = guard.roles
if is_permitted_worklist:
format_data = TemplateDict()
format_data._push(info)
format_data._push({'portal_type': ' OR '.join(variable_match['portal_type']),
......@@ -254,6 +261,7 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info):
'action_box_url': worklist_definition.actbox_url,
'action_box_category': worklist_definition.actbox_category}
variable_match_dict[worklist_id] = variable_match
if len(variable_match_dict) == 0:
return None
return variable_match_dict
......
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