Thanks to Dmitry and Maik, it works fine. So now I need to set the new ZTP contents to those of a model ZPT. Following Dmitry's advice, I read the ZPT source and figured I could do the following: instance.manage_addProduct['PageTemplates'].manage_addPageTemplate('index_html') instance['index_html'].write(instance.memberIndex.document_src(self)) but no, I get: Error Type: Unauthorized Error Value: You are not allowed to access document_src in this context I am logged in as 'manager'. I have tried: instance['index_html'].write(str(instance.memberIndex)) where memberIndex is a regular file and this works fine, but I want to use a model ZPT. Guidance needed, please! Richard (every step an adventure!)
...I read the ZPT source and figured I could do the following:
instance.manage_addProduct['PageTemplates'].manage_addPageTemp late('index_html') instance['index_html'].write(instance.memberIndex.document_src(self))
but no, I get:
Error Type: Unauthorized Error Value: You are not allowed to access document_src in this context
I am logged in as 'manager'. I have tried:
instance['index_html'].write(str(instance.memberIndex)) where memberIndex is a regular file and this works fine, but I want to use a model ZPT.
1) method document_src() requires no parameters (self is passed implicitly by python) So you may write context['index_html'].write(context.memberIndex.document_src()) 2) To create a page template with a content, you may pass it in constructor: container.manage_addProduct['PageTemplates'].manage_addPageTemplate('ind ex_html', text=context.memberIndex.document_src()) Enjoy :) Dmitry
Richard Jennings wrote at 2003-5-14 11:50 +0200:
... instance['index_html'].write(instance.memberIndex.document_src(self))
but no, I get:
Error Type: Unauthorized Error Value: You are not allowed to access document_src in this context
I do not see why you cannot access "document_src". However, Shane's "VerboseSecurity" products is a valuable help for the analysis of authorization problem. Maybe, I gives you a glue... Dieter
participants (3)
-
Dieter Maurer -
Dmitry Dembinsky -
Richard Jennings