[Zope-dev] Re: [Zope] Re: Not authorized to access binding

Tres Seaver tseaver at palladion.com
Thu May 25 16:41:07 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Antonio Beamud Montero wrote:
> El jue, 25-05-2006 a las 12:49 -0400, Tres Seaver escribió:
> 
> If this template needs to be renderable by anonymous users even for
> contexts to which they do not have access, then you can give the
> template a proxy role which *does* have access.  Use with caution, and
> double check that the template won't expose any data which *should* be
> protected.
> 
> 
>> How I can do it in the Product code? I cannot find in the API...

It depends on how your template is created:

  - If it is a CMF FilesystemPageTemplate, then you can set the
    proxy role in the associated '.metadata' file.  See the
    example in CMFCore's tests[1].

  - If it is a PageTemplateFile, created as an attribute of a
    Product class, then set the attribute '_proxy_roles' on the
    instance.


[1]
http://svn.zope.org/CMF/branches/1.5/CMFCore/tests/fake_skins/fake_skin/test_dtml.dtml.metadata?rev=40122


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEdhZj+gerLs4ltQ4RAiAQAKCtSW7iNfoO2WO0Y0K7+oPDWLKOHQCeKvzH
EEIAifSlPSE+uiF6wTiZHrI=
=KXNK
-----END PGP SIGNATURE-----


More information about the Zope-Dev mailing list