[CMF-checkins] CVS: Products/CMFCore - MembershipTool.py:1.53

Tres Seaver tseaver at palladion.com
Thu Jul 7 14:28:17 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv9270/CMFCore

Modified Files:
	MembershipTool.py 
Log Message:
 - Forward-port fix for collector #354 from 1.5 branch.


=== Products/CMFCore/MembershipTool.py 1.52 => 1.53 ===
--- Products/CMFCore/MembershipTool.py:1.52	Thu Apr  7 12:38:46 2005
+++ Products/CMFCore/MembershipTool.py	Thu Jul  7 14:27:46 2005
@@ -346,10 +346,23 @@
         '''
         Returns the given member.
         '''
-        u = self.acl_users.getUserById(id, None)
-        if u is not None:
-            u = self.wrapUser(u)
-        return u
+        def hauntUser(username,start):
+            """Find user in the hierarchy starting from bottom level 'start'.
+            """
+            uf = start.acl_users
+            while uf is not None:
+                user = uf.getUserById(username)
+                if user:
+                    return user
+                parent = aq_parent(aq_inner(uf))
+                parent = aq_parent(aq_inner(parent))
+                uf = getattr(parent, 'acl_users', None)
+            return None
+
+        user = hauntUser(id, self)
+        if user is not None:
+            user = self.wrapUser(user)
+        return user
 
     def __getPUS(self):
         # Gets something we can call getUsers() and getUserNames() on.



More information about the CMF-checkins mailing list