Commit 585d043a authored by iv's avatar iv

ERP5Workflow: temporarily change listAction security, add XXX comments, rename variables

parent 4d78759b
......@@ -95,6 +95,7 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
return res
def getGuard(self):
# XXX(WORKFLOW): same code in Worklist, please unify
if self.getGuardRoleList() is None and\
self.getGuardPermissionList() is None and\
self.getGuardGroupList() is None and\
......
......@@ -85,6 +85,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
return res
def getGuard(self):
# XXX(WORKFLOW), I would remove the complete first if below
if self.getGuardRoleList() is None and\
self.getGuardPermissionList() is None and\
self.getGuardGroupList() is None and\
......@@ -166,13 +167,13 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def getVarMatchKeys(self):
key_list = []
if self.getMatchedPortalTypeList() is not None:
if self.getMatchedPortalTypeList():
key_list.append('portal_type')
if self.getMatchedSimulationStateList() is not None:
if self.getMatchedSimulationStateList():
key_list.append('simulation_state')
if self.getMatchedValidationStateList() is not None:
if self.getMatchedValidationStateList():
key_list.append('validation_state')
if self.getMatchedCausalityState() is not None:
if self.getMatchedCausalityState():
key_list.append('causality_state')
for dynamic_variable in self.objectValues():
if dynamic_variable.getVariableValue() or dynamic_variable.getVariableExpression():
......
......@@ -783,6 +783,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def delTypeCBT(self, pt, wf_id):
self._chains_by_type[pt] = tuple(wf for wf in self._chains_by_type[pt] if wf!=wf_id)
# XXX(WORKFLOW) check what was the security before
security.declarePublic('listActions')
def listActions(self, info=None, object=None, src__=False):
"""
Returns a list of actions to be displayed to the user.
......@@ -827,22 +829,21 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
did[wf_id] = None
wf = self.getWorkflowById(wf_id)
if wf is not None:
a = wf.listObjectActions(info)
if a is not None:
actions.extend(a)
a = wf.getWorklistVariableMatchDict(info)
if a is not None:
worklist_dict[wf_id] = a
object_action_list = wf.listObjectActions(info)
if object_action_list is not None:
actions.extend(object_action_list)
worklist_variable_dict = wf.getWorklistVariableMatchDict(info)
if worklist_variable_dict is not None:
worklist_dict[wf_id] = worklist_variable_dict
wf_ids = self.getWorkflowIds()
for wf_id in wf_ids:
if not did.has_key(wf_id):
wf = self.getWorkflowById(wf_id)
if wf is not None:
a = wf.getWorklistVariableMatchDict(info)
if a is not None:
worklist_dict[wf_id] = a
worklist_variable_dict = wf.getWorklistVariableMatchDict(info)
if worklist_variable_dict is not None:
worklist_dict[wf_id] = worklist_variable_dict
if worklist_dict:
portal = self.getPortalObject()
portal_url = portal.portal_url()
......
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