Commit 60321ce3 authored by iv's avatar iv

ERP5Type: Python Scripts should not acquire guard restrictions

When defining a guard on an object, calling
a method such as Base_viewDict on that object
could be denied due to guard acquisition.
parent a6b61b2d
...@@ -161,7 +161,7 @@ def checkGuard(guard, ob): ...@@ -161,7 +161,7 @@ def checkGuard(guard, ob):
PythonScript_exec = PythonScript._exec PythonScript_exec = PythonScript._exec
def _exec(self, *args): def _exec(self, *args):
# PATCH BEGIN : check guard against context, if guard exists. # PATCH BEGIN : check guard against context, if guard exists.
guard = getattr(self, 'guard', None) guard = getattr(aq_base(self), 'guard', None)
if guard is not None: if guard is not None:
if not checkGuard(guard, aq_parent(self)): if not checkGuard(guard, aq_parent(self)):
raise Forbidden, 'Calling %s %s is denied by Guard.' % (self.meta_type, self.id) raise Forbidden, 'Calling %s %s is denied by Guard.' % (self.meta_type, self.id)
......
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