[Zope] Re: the joy of hacking ZPublisher

Tres Seaver tseaver at palladion.com
Wed May 18 15:09:40 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jim Abramson wrote:

> In my Zope 2.7 Product, I'm trying to implement a special folder, which
> intercepts the publishing call to any subobject and wraps the entire
> call in another.
> 
> A concrete example: where the default action would be to traverse
> /MyProduct/SpecialFolder/something, and publish the attr 'something'
> from SpecialFolder, I want this to happen instead:
> 
> doSomethingBeforeCallingTheRequestedObj()
> try:
>     return mapply( something, blahblah...)
> finally:
>     doSomethingAfterCallingTheRequestedObj()
> 
> Why? I need to do stuff to the REQUEST before the object is called (this
> part wasn't difficult), and then do something *after* it's called - no
> matter what the results were.  But only for publishables that live in or
> beneath the Special Folder.

Sounds like you want what AccessRules provide, which is a way to provide
a configurable hook into the publishing traversal process.  The
following thread explains the rationale for that hook, from before it
was included in Zope proper:

  http://mail.zope.org/pipermail/zope-dev/1999-December/002667.html

> In fact I have something working, but one big problem - it breaks
> management screens in a bad way.  The implementation is pasted below.
> Is there some much simpler way to accomplish this behavior?  And am I
> short-circuiting security machinery in some dangerous way?


Tres.
- --
===================================================================
Tres Seaver                                   tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCi5L0+gerLs4ltQ4RAvexAJ9jh3QN7Nk5HN+zjdjQzUeshX4NAwCfQgEF
fhJpTReSx95BQ4aR3KG69IM=
=LsRY
-----END PGP SIGNATURE-----



More information about the Zope mailing list