Commit b7e2a135 authored by Martijn Pieters's avatar Martijn Pieters

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.
parent 72c0de0c
......@@ -12,8 +12,8 @@
##############################################################################
__doc__='''Tree manipulation classes
$Id: Tree.py,v 1.13 2002/10/05 21:24:03 mj Exp $'''
__version__='$Revision: 1.13 $'[11:-2]
$Id: Tree.py,v 1.14 2002/10/07 19:43:14 mj Exp $'''
__version__='$Revision: 1.14 $'[11:-2]
from Acquisition import Explicit
from ComputedAttribute import ComputedAttribute
......@@ -208,6 +208,9 @@ class TreeMaker:
# 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
......
......@@ -12,8 +12,8 @@
##############################################################################
__doc__='''Zope-specific versions of ZTUTils classes
$Id: Zope.py,v 1.10 2002/08/14 22:10:12 mj Exp $'''
__version__='$Revision: 1.10 $'[11:-2]
$Id: Zope.py,v 1.11 2002/10/07 19:43:15 mj Exp $'''
__version__='$Revision: 1.11 $'[11:-2]
import sys, cgi, urllib, cgi
from Tree import encodeExpansion, decodeExpansion, TreeMaker
......@@ -99,6 +99,9 @@ class TreeSkipMixin:
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment