Commit 842bb92e authored by Vincent Pelletier's avatar Vincent Pelletier

Make ActivityRuntimeEnvironment.edit callable from restricted python.

parent 781c4d63
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass
def getActivityRuntimeEnvironment(): def getActivityRuntimeEnvironment():
""" """
...@@ -34,10 +36,12 @@ class BaseMessage: ...@@ -34,10 +36,12 @@ class BaseMessage:
class ActivityRuntimeEnvironment(object): class ActivityRuntimeEnvironment(object):
security = ClassSecurityInfo()
def __init__(self, message): def __init__(self, message):
self._message = message self._message = message
security.declarePublic('edit')
def edit(self, **kw): def edit(self, **kw):
# There is no point allowing to modify other attributes from a message # There is no point allowing to modify other attributes from a message
for k in kw: for k in kw:
...@@ -46,3 +50,5 @@ class ActivityRuntimeEnvironment(object): ...@@ -46,3 +50,5 @@ class ActivityRuntimeEnvironment(object):
self._message.activity_kw.get(k) is not None: self._message.activity_kw.get(k) is not None:
raise RuntimeError("An error callback is already registered") raise RuntimeError("An error callback is already registered")
self._message.activity_kw.update(kw) self._message.activity_kw.update(kw)
InitializeClass(ActivityRuntimeEnvironment)
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