[Zope] Re: use traversed subpath to insert REQUEST variables
Dieter Maurer
dieter at handshake.de
Sat Sep 13 07:37:32 EDT 2003
Tobias Herp wrote at 2003-9-11 11:38 +0200:
> ...
> I hoped to avoid the AccessRule thing and have a
> solution inside my portal product (which can contain site objects in
> varying level depths). A site object would easily know e.g whether or
> not the two following path elements are a valid language and layout.
>
> Is it more difficult or dangerous to use the __bobo_traverse__ method?
Inside product code, "__bobo_traverse__" is (usually) easy, too.
There are several differences:
"__bobo_traverse__" must return an object while the basic
mechanisms behind AccessRules ("__before_publishing_traverse__")
can simple check things or manipulate the traversal stack
and let locations to something else.
"__bobo_traverse__" is used by "[un]restrictedTraverse" (and,
therefore, TALES path expressions) while "__before_publishing_traverse__"
is only used by ZPublisher traversal.
As Evan pointed out, you do not need to use an AccessRule.
You can use "__before_publishing_traverse__" in your product directly.
Dieter
More information about the Zope
mailing list