[Zope-Checkins] CVS: Zope2 - User.py:1.133.2.11

shane@digiciool.com shane@digiciool.com
Mon, 12 Mar 2001 12:09:48 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/AccessControl
In directory korak:/tmp/cvs-serv28715

Modified Files:
      Tag: zope-2_3-branch
	User.py 
Log Message:
Removed workaround for aq_inContextOf().



--- Updated File User.py in package Zope2 --
--- User.py	2001/03/09 17:20:35	1.133.2.10
+++ User.py	2001/03/12 17:09:47	1.133.2.11
@@ -248,11 +248,7 @@
                             # Fail the access attempt.  Otherwise
                             # this would be a security hole.
                             return None
-                    # -----------------------------------------------------
-                    # FIXME: this is a workaround for broken aq_inContextOf
-                    # -----------------------------------------------------
-                    # if not object.aq_inContextOf(ucontext, 1):
-                    if not isInContext(ucontext, object):
+                    if not object.aq_inContextOf(ucontext, 1):
                         if 'Shared' in object_roles:
                             # Damn, old role setting. Waaa
                             object_roles=self._shared_roles(object)
@@ -1065,15 +1061,5 @@
 def reqattr(request, attr):
     try:    return request[attr]
     except: return None
-
-from Acquisition import aq_base, aq_inner, aq_parent
-def isInContext(fixed, variable):
-    fixed = aq_base(fixed)
-    while variable is not None:
-        v = aq_base(variable)
-        if v is fixed:
-            return 1
-        variable = aq_parent(aq_inner(variable))
-    return 0
 
 Super = UnrestrictedUser  # Note: use of the Super alias is deprecated.