From 60321ce3d5629ac29560b9bb05728cbd48beb5c0 Mon Sep 17 00:00:00 2001 From: Isabelle Vallet <isabelle.vallet@nexedi.com> Date: Fri, 10 Jun 2016 10:17:23 +0000 Subject: [PATCH] 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. --- product/ERP5Type/patches/PythonScript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/ERP5Type/patches/PythonScript.py b/product/ERP5Type/patches/PythonScript.py index 4335f1040d..f76376e11c 100644 --- a/product/ERP5Type/patches/PythonScript.py +++ b/product/ERP5Type/patches/PythonScript.py @@ -161,7 +161,7 @@ def checkGuard(guard, ob): PythonScript_exec = PythonScript._exec def _exec(self, *args): # 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 not checkGuard(guard, aq_parent(self)): raise Forbidden, 'Calling %s %s is denied by Guard.' % (self.meta_type, self.id) -- 2.30.9