[ZPT] PageTemplateFile, restricted code?

Michael R. Bernstein mbernstein@codeit.com
28 Feb 2002 16:25:54 -0800


On Tue, 2001-11-13 at 07:56, Juan David Ib=E1=F1ez Palomar wrote:
> Hi all,
>=20
> It seems that PageTemplateFile is interpreted as restricted
> code, while DTMLFile is unrestricted code.
>=20
> Is this the right behaviour? Since PageTemplateFile live in
> the file system IMO they should be unrestricted code.

Juan,

As you discovered, PageTemplateFiles are restricted code. I just
discovered this myself, and looking back through the list, found your
posting.

Here is Evan's reply regarding this decision:

-----Forwarded Message-----

From: Evan Simpson <evan@zope.com>
To: Michael R. Bernstein <mbernstein@codeit.com>
Cc: Zope Page Templates <zpt@zope.org>
Subject: Re: [ZPT] Are PageTemplateFiles restricted code?
Date: 28 Feb 2002 12:33:38 -0500

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=20
the idea that presentation code shouldn't need special access, and=20
partly to facilitate 'skinning' (move the code into a ZopePageTemplate,=20
and it should still work).  It is inconsistent with DTMLFile.


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