Log message for revision 78438:
  More proper usage of the aq_* methods
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
  U   Zope/branches/philikon-aq/lib/python/AccessControl/User.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py    
2007-07-28 20:53:59 UTC (rev 78437)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py    
2007-07-28 21:09:57 UTC (rev 78438)
@@ -17,6 +17,7 @@
 
 import string, Products, Globals
 
+from Acquisition import aq_base
 
 name_trans=filter(lambda c, an=string.letters+string.digits+'_': c not in an,
                   map(chr,range(256)))
@@ -36,8 +37,7 @@
         self.name=name
         self._p='_'+string.translate(name,name_trans)+"_Permission"
         self.data=data
-        if hasattr(obj, 'aq_base'): obj=obj.aq_base
-        self.obj=obj
+        self.obj=aq_base(obj)
         self.default=default
 
     def getRoles(self, default=_marker):

Modified: Zope/branches/philikon-aq/lib/python/AccessControl/User.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
20:53:59 UTC (rev 78437)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
21:09:57 UTC (rev 78438)
@@ -20,6 +20,8 @@
 import socket
 from base64 import decodestring
 
+from Acquisition import aq_base
+from Acquisition import aq_parent
 from Acquisition import aq_inContextOf
 from Acquisition import Implicit
 from App.Management import Navigation, Tabs
@@ -152,7 +154,7 @@
             if getattr(parent, '__parent__', None) is not None:
                 while hasattr(parent.aq_self,'aq_self'):
                     parent = parent.aq_self
-                parent = parent.__parent__
+                parent = aq_parent(parent)
             else: return r
 
     def _check_context(self, object):
@@ -772,7 +774,7 @@
 
     def _isTop(self):
         try:
-            return self.__parent__.aq_base.isTopLevelPrincipiaApplicationObject
+            return 
aq_base(aq_parent(self)).isTopLevelPrincipiaApplicationObject
         except:
             return 0
 
@@ -987,8 +989,8 @@
 
     def manage_afterAdd(self, item, container):
         if item is self:
-            if hasattr(self, 'aq_base'): self=self.aq_base
-            container.__allow_groups__=self
+            self = aq_base(self)
+            container.__allow_groups__ = self
 
     def __creatable_by_emergency_user__(self): return 1
 

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to