unauthorized tal repeat by class method
hello all I'm currently migrating some of my dtml stuff of my python product to page templates and have the following odd issue. i pass an instance of a none-zopish class to a page template as keyword. in the page template i can access the instance, but cannot invoke a method on it which returns me a sequence of other classes here the snipped of my zpt file: <div tal:repeat="activity python:options['wf_activity'].getActions()"> traceback snippet: * Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__ __traceback_info__: options['wf_activity'].getActions() * Module Python expression "options['wf_activity'].getActions()", line 1, in <expression> Unauthorized: You are not allowed to access 'getActions' in this context (Also, an error occurred while attempting to render the standard error message.) end: in dtml this works without problem: dtml snippet: <dtml-with wf_activity> <dtml-in getActions> ... ... </dtml-in> </dtml-with> my setup: Zope Version (Zope 2.7.0-a1, python 2.2.3, win32) Python Version 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] System Platform win32 end: tia, bernd
Bernd Dorn wrote at 2003-9-16 11:47 +0200:
... i pass an instance of a none-zopish class to a page template as keyword.
in the page template i can access the instance, but cannot invoke a method on it which returns me a sequence of other classes
You know about security declarations (you need them!). Please read the Zope Developper Guide. When something is not declared public, the corresponding class must also derive from "Acquisition.{Im|Ex}plicit" and the instance must be acquisition wrapped. Dieter
Dieter Maurer wrote:
Bernd Dorn wrote at 2003-9-16 11:47 +0200:
... i pass an instance of a none-zopish class to a page template as keyword.
in the page template i can access the instance, but cannot invoke a method on it which returns me a sequence of other classes
You know about security declarations (you need them!). Please read the Zope Developper Guide.
When something is not declared public, the corresponding class must also derive from "Acquisition.{Im|Ex}plicit" and the instance must be acquisition wrapped.
Dieter
thanks i found it out myself yesterday just for the records: it doesnt have to be wrapped, at least in my case my objects are not persistent, they are created on the fly and are not an attribute of some zopish object and i have not done any __of__ stuff with them, but it works sg, bernd
participants (2)
-
Bernd Dorn -
Dieter Maurer