Commit 8dcfe548 authored by Sebastien Robin's avatar Sebastien Robin

ERP5Workflow: add security declarations

parent e80dfc7a
......@@ -74,8 +74,12 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject,
else:
self.variable_expression = None
security.declareProtected(Permissions.ModifyPortalContent,
'setVariableExpressionText')
def setVariableExpressionText(self, text):
self.variable_expression = Expression(text)
security.declareProtected(Permissions.AccessContentsInformation,
'getVariableExpressionText')
def getVariableExpressionText(self):
return getattr(self.variable_expression, 'text', '')
......@@ -74,6 +74,8 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
PropertySheet.ActionInformation,
)
security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableCatalogVars')
def getAvailableCatalogVars(self):
parent = self.getParentValue()
res = [parent.getStateVariable()]
......@@ -84,6 +86,8 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
res.sort()
return res
security.declareProtected(Permissions.ModifyPortalContent,
'updateDynamicVariable')
def updateDynamicVariable(self):
# Keep worklist variables updating, correspond to workflow variables.
# In the new workflow, we may not need this function for the moment.
......
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