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