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,20 +240,28 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info): ...@@ -240,20 +240,28 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info):
if action_box_name: 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 = 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) 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 variable_match[SECURITY_PARAMETER_ID] = guard.roles
format_data = TemplateDict()
format_data._push(info) if is_permitted_worklist:
format_data._push({'portal_type': ' OR '.join(variable_match['portal_type']), format_data = TemplateDict()
'local_roles': ';'.join(variable_match.get(SECURITY_PARAMETER_ID, []))}) format_data._push(info)
variable_match[WORKLIST_METADATA_KEY] = {'format_data': format_data, format_data._push({'portal_type': ' OR '.join(variable_match['portal_type']),
'worklist_title': action_box_name, 'local_roles': ';'.join(variable_match.get(SECURITY_PARAMETER_ID, []))})
'worklist_id': worklist_id, variable_match[WORKLIST_METADATA_KEY] = {'format_data': format_data,
'workflow_title': self.title, 'worklist_title': action_box_name,
'workflow_id': self.id, 'worklist_id': worklist_id,
'action_box_url': worklist_definition.actbox_url, 'workflow_title': self.title,
'action_box_category': worklist_definition.actbox_category} 'workflow_id': self.id,
variable_match_dict[worklist_id] = variable_match '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: if len(variable_match_dict) == 0:
return None return None
return variable_match_dict 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