[ZPT] Please help: No protection for PageTemplateFile!!

Florent Guillaume fg@nuxeo.com
Tue, 29 Jan 2002 12:48:25 +0000 (UTC)


Dirksen Lau  <dirksen.lau@polyu.edu.hk> wrote:
> Hi,
> 
> I want to shut off anonymous access to my class, but to my surprise,
> instances of PageTemplateFile leak through the security check, even the id
> of which starts with 'manage_'! Here's my class

Have you tried to use the security model like thus :

from AccessControl import ClassSecurityInfo
...
class Dummy:
    security = ClassSecurityInfo()
    security.declareProtected('somepermission', 'index_html')
    index_html = PageTemplateFile('F:/zope2/lib/.../view.zpt', globals(), __name__='index_html')

Globals.InitializeClass(Dummy)

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:fg@nuxeo.com