Hello, I use a Python Script to set some parameters before calling a Page Template document. The call is done in the following way: if REQUEST is not None: return container['test.zpt'](REQUEST, name=name, title=title) Unfortunately this does not seem to work for anonymous user because I will be presented by a passwort autentification question and if I cancel this I get: Zope has encountered an error while publishing this resource. Error Type: Unauthorized Error Value: You are not allowed to access document_src in this context Any hints how to make this accessible for anonymous user? I see two ways here: 1. Call it the "right way" (but what would it be?) 2. Adapt permissions correctly (but without opening a hole). Kind regards Andreas.
Andreas Tille wrote:
Hello,
I use a Python Script to set some parameters before calling a Page Template document. The call is done in the following way:
if REQUEST is not None: return container['test.zpt'](REQUEST, name=name, title=title)
Unfortunately this does not seem to work for anonymous user because I will be presented by a passwort autentification question and if I cancel this I get:
works for me even for anonymous... have you checked, that test.zpt can be viewed by anonymous without problems? -maik -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
On Wed, 9 Oct 2002, Maik Jablonski wrote:
if REQUEST is not None: return container['test.zpt'](REQUEST, name=name, title=title)
works for me even for anonymous... have you checked, that test.zpt can be viewed by anonymous without problems? Thanks for checking this problem. Now I know the problem better. The reason is that I try to insert some unrendered text from some DTML-documents. I tried to do this by calling a Python Script from the Page Template above. The script looks like this ...
## Script (Python) "Content" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=name=None ##title=Return content / 'name' ## if name == None: name='default' foundname='default' cont = container.content for folder in cont.objectValues(): if name == folder.getId(): foundname=name break return cont[foundname].document_src() Here is the call which causes the problem with the Zope has encountered an error while publishing this resource. Error Type: Unauthorized Error Value: You are not allowed to access document_src in this context Any other reasonable way to obtain unrendered text? Kind regards Andreas.
participants (2)
-
Andreas Tille -
Maik Jablonski