[Zope] Please help! can't do a redirect in a access rule

Dieter Maurer dieter at handshake.de
Tue Mar 30 13:32:42 EST 2004


Bruno Silva wrote at 2004-3-30 15:10 +0100:
>    I'm trying to give access to a folder, only if a user has a value in
>is session. I configured a Site Access Rule that looks like this:
>
>
>if context.REQUEST['BASE0'].find('zope') > -1:
>    return #does nothing for now
>elif context.REQUEST.SESSION.has_key('give_access'):
>    return #does nothing for now
>context.REQUEST.RESPONSE.redirect(context.REQUEST['BASE0'])

"redirect" does not stop the publishing process and is
therefore unreliable.

Use "raise 'Redirect', location" instead.

-- 
Dieter



More information about the Zope mailing list