[Zope3-dev] ObjectCreatedEvent handlers and local permissions

Garrett Smith garrett at mojave-corp.com
Sat Feb 12 12:33:09 EST 2005


The subscriber really doesn't want added events -- it wants created
events. It should be possible to apply local permission settings based
on the context in which an object is created.

After playing around a bit, the use of LocationProxy I think is the
right approach.

 -- Garrett

Stephan Richter wrote:
> permissions
> 
> 
> On Saturday 12 February 2005 11:33, Garrett Smith wrote:
>> I have a handler for an object created event and I need local
>> permissions to apply, but since the newly created object has no
>> parent, only the global permissions are used.
>> 
>> This makes sense since the new object has no location and thus we
>> can't use local permissions. 
>> 
>> Is the solution to wrap the new object in a location proxy for its
>> use in a notify call: 
>> 
>>   notify(ObjectCreatedEvent(LocationProxy(obj, parent, name)))
> 
> If a subscriber depends on the location, you should listen to
> ObjectAddedEvent.
> 
> Regards,
> Stephan



More information about the Zope3-dev mailing list