[Zope] securityinfo for a class

Fernando Martins fmartins@hetnet.nl
Sun, 13 Jul 2003 23:45:41 +0200


Double thanks! For this solution and for writing the minimal howtos. That's
where I started to prepare for the product I'm writing.

Cheers,
Fernando

Max M wrote:
> Fernando Martins wrote:
>
> > Hello,
> >
> > I'm creating a Product with a function retrieve(self, num)
> which returns an
> > email.Message object.
> >
> > In a zpt of the product I've
> >
> > <div tal:define="msg python:here.retrieve(request['num'])">
> >
> > and I would like to manipulate msg using email.Message methods, like in
> >
> >     <td tal:content="python:msg.get('from')">name</td>
> >
> > I've added these delarations to my __init__.py
> >
> > ModuleSecurityInfo('email').declarePublic('Message')
> > ModuleSecurityInfo('Message').declarePublic('get')
> >
> > This doesn't work, it prompts the login box.
> >
> > How can I use Message's methods in a page template or Python Script?
>
>
> Either use a wrapper, or set the:
>
> email.Message.__allow_access_to_unprotected_subobjects__=1
>
> on the email instance.
>
> regards Max M
>