Hi,

we are wondering about the behaviour in the following situation:

* self is a view and we're in a method of that view

* self.context is an instance of class A 
  (A is a content class and a folder)

* self.context is security proxied

* class A has a method doStuff

* we call self.context.doStuff()

* in doStuff, self is not proxied

* accessing other things through self[id] in doStuff does not give a
  proxied object

Result: code can perform operations that users normally could not do,
without anybody calling "removeAllProxies" explicitly.

Is this intentional? I'm not sure about that. I feel like those calls
should work with proxied objects as well.

Christian

PS: It seems that the _zope_security_proxy.c code and the corresponding
Python code are a little bit out of sync. The C-code does a little bit
more that isn't in the python code anymore. See this patch:

--- checker.py  (Revision 41246)
+++ checker.py  (Arbeitskopie)
@@ -371,6 +371,9 @@
     if checker is NoProxy:
         return None

+    if checker is _defaultChecker and isinstance(object, Exception):
+        return None
+
     while not isinstance(checker, Checker):
         checker = checker(object)
         if checker is NoProxy or checker is None:

As stated in _zope_security_proxy.c line 495:

/*     if checker is _defaultChecker and isinstance(object, Exception):
*/
/*         return None */

  if (checker == _defaultChecker
      && PyObject_IsInstance(object, PyExc_Exception))
    {
      Py_INCREF(Py_None);
      return Py_None;
    }


-- 
gocept gmbh & co. kg - forsterstra├če 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to