[Zope] set accessrule
jbr@FIZ-Karlsruhe.DE
jbr@FIZ-Karlsruhe.DE
Thu, 21 Mar 2002 18:48:16 +0100 (MET)
Hello,
I have difficulties with accessrule. I am using zope 2.5.0
I have a folder named testfolder.
For this folder I have set accessrule to the python script
accessruleHB, which is in folder testfolder.
-----------------------------------------
## Script (Python) "accessruleHB"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=REQUEST=None
##title=
##
# Import a standard function, and get the HTML request and response objects.
# from Products.PythonScripts.standard import html_quote
session = context.REQUEST.SESSION
sessionId=session.get('MySessionId')
if sessionId == None:
REQUEST.RESPONSE.redirect('/rootfolder')
-----------------------------------------
But it seems that this script is not called automatically by
set accessrules, because nothing happens.
What I want is: If sombody is accessing folder testfolder, accessrule
for this folder should call accessruleHB to redirect people (and thus
to deny access) if they are not authorized.
If I run the script standalone ( by calling it) it redirects to rootfolder.
What have I done wrong with setaccessrule ?
With kind regards, Juergen Berger