Commit 8778072e authored by iv's avatar iv

ERP5Workflow: remove getGuard on worklists

parent b6698116
......@@ -350,7 +350,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
workflow_title = self.getTitle()
for worklist_value in self.getWorklistValueList():
action_box_name = worklist_value.getActionName()
guard = worklist_value.getGuard()
is_guarded = (worklist_value.getGuardRoleList() or
worklist_value.getGuardGroupList() or
worklist_value.getGuardPermissionList() or
worklist_value.getGuardExpression().text)
guard_role_list = worklist_value.getGuardRoleList()
if action_box_name:
variable_match = {}
for key in worklist_value.getVarMatchKeys():
......@@ -376,12 +380,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
continue
is_permitted_worklist = 0
if guard is None:
if is_guarded:
is_permitted_worklist = 1
elif (not check_guard) or \
Guard_checkWithoutRoles(guard, security_manager, self, portal):
elif (not check_guard): # XXX(WORKFLOW): there was: "or Guard_checkWithoutRoles(guard, security_manager, self, portal)"
is_permitted_worklist = 1
variable_match[SECURITY_PARAMETER_ID] = guard.roles
variable_match[SECURITY_PARAMETER_ID] = guard_role_list
if is_permitted_worklist:
fmt_data = TemplateDict()
......
......@@ -57,7 +57,6 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
description = ''
var_matches = [] # Compared with catalog when set.
matched_portal_type = ''
guard = None
default_reference = ''
# Declarative security
security = ClassSecurityInfo()
......
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