[Zope3-Users] Re: Programmatically changing GroupInformation.principals

Andreas Elvers andreas at work.de
Wed Apr 12 08:53:21 EDT 2006


Thanks Michael,
this did the trick.

> 
> Zope3 stores the current site in a tread-global variable, so if you want 
> to change this context, you have to set a hook like this:
> 
> 
> try:
>     old_site = zope.app.component.hooks.getSite()
>     zope.app.component.hooks.setSite(root_folder)
> 
>     # do the pau things
> 
> finally:
>     zope.app.component.hooks.setSite(old_site)
> 
> 
> Where root_folder is the object providing ISite (the site containing 
> your PAU).
> 
> 
> HTH



More information about the Zope3-users mailing list