[Zope3-Users] Re: security problem setting Annotations with an adapter

Dominique Lederer dominique.lederer at inode.at
Sat Nov 11 06:15:22 EST 2006


Philipp von Weitershausen schrieb:
> Dominique Lederer wrote:
>> i just added an adapter to my content-class, which gets and sets some
>> Annotations.
>>
>> at the moment i do this in the adapters init to be able to set them:
>>
>> def __init__(self, context):
>>         from zope.security.proxy import removeSecurityProxy
>>         self.context = removeSecurityProxy(context)
>>
>> otherwise i get an
>> ForbiddenAttribute: ('__annotations__', <my_class object at 0xa6853cec>
>> Error
>>
>> whats the right way to tell the zope security policy that setting
>> Annotaions via Adapter is allowed?
> 
> Like Stephan said, you make the adapter trusted. See my book for
> detailed explanations and an example.
> 
> 

thank you both very much.



More information about the Zope3-users mailing list