[ZPT] Are PageTemplateFiles restricted code?

Michael R. Bernstein mbernstein@codeit.com
28 Feb 2002 10:57:50 -0800


On Thu, 2002-02-28 at 09:33, Evan Simpson wrote:
> Michael R. Bernstein wrote:
> > It seems that a PageTemplateFile in a class cannot access simple class
> > attributes when the class has it's default access policy set to 'deny'.
> 
> Yes, PageTemplateFiles are fully restricted.  This is based partly on 
> the idea that presentation code shouldn't need special access, and 
> partly to facilitate 'skinning' (move the code into a ZopePageTemplate, 
> and it should still work).  It is inconsistent with DTMLFile.

Damn. How then am I supposed to do:

<title tal:content="/here/title">The Title</title>

...when I lock down the class as deny by default with:

security.setDefaultAccess("deny")?

I don't want to grant access to unrestricted code, and I don't want to
write a bunch of accessor methods.

Michael.
-- 
---------------------------------------------------
| Michael Bernstein   http://michaelbernstein.com |
|                                                 |
| CodeIt Computing    http://codeit.com           |
---------------------------------------------------