[ZPT] CVS: Zope/lib/python/ZTUtils - Tree.py:1.14 Zope.py:1.11

Martijn Pieters mj@zope.com
Mon, 7 Oct 2002 15:43:15 -0400


Update of /cvs-repository/Zope/lib/python/ZTUtils
In directory cvs.zope.org:/tmp/cvs-serv1386/lib/python/ZTUtils

Modified Files:
	Tree.py Zope.py 
Log Message:
ZTUtils.Zope.TreeSkipMixin is used to help skip items in the tree the user
is not authenticated to access. However, any custom filter set through
setChildAccess was getting the unfiltered list of child nodes. Change this
so a filtered list of nodes s handed to the custom filter.


=== Zope/lib/python/ZTUtils/Tree.py 1.13 => 1.14 ===
--- Zope/lib/python/ZTUtils/Tree.py:1.13	Sat Oct  5 17:24:03 2002
+++ Zope/lib/python/ZTUtils/Tree.py	Mon Oct  7 15:43:14 2002
@@ -208,6 +208,9 @@
             # Assume callable; result not useful anyway otherwise.
             children = children()
 
+        return self.filterChildren(children)
+
+    def filterChildren(self, children):
         if self._values_filter:
             return self._values_filter(children)
         return children


=== Zope/lib/python/ZTUtils/Zope.py 1.10 => 1.11 ===
--- Zope/lib/python/ZTUtils/Zope.py:1.10	Wed Aug 14 18:10:12 2002
+++ Zope/lib/python/ZTUtils/Zope.py	Mon Oct  7 15:43:15 2002
@@ -99,6 +99,9 @@
         return self
     def getChildren(self, object):
         return LazyFilter(self._getChildren(object), skip=self.skip)
+    def filterChildren(self, children):
+        if self._values_filter:
+            return self._values_filter(LazyFilter(children, skip=self.skip))
 
 class TreeMaker(TreeSkipMixin, TreeMaker):
     _getChildren = TreeMaker.getChildren