[Zope3-dev] persistent event subscribers?

Jim Fulton jim at zope.com
Mon Sep 25 14:52:44 EDT 2006


On Sep 25, 2006, at 1:20 PM, Chris Withers wrote:

> Jim Fulton wrote:
>> It isn't at the most basic level.  Security gets rather difficult  
>> if you let non-fully-trusted people create subscribers.
>
> OK, wasn't specifically worrying about security, but why do you see  
> this as being an issue?

Because subscribers are a form of code.  TTW subscribers would be a  
form of TTW code.


>> We already have persistent subscribers now, in a round about way.   
>> There are global subscribers whos job it is to notify utilities of  
>> certain events, making those utilities effective subscribers.
>
> ...and utilities being local utilities that exist in he zodb?

Yes.

> The problem I'm trying to get my head round would be how to make  
> the following hypothetical zcml actually work:
>
> <subscriber for="Ix Ix"
>             path="/my/zcatalog"/>


What you would do is create a Python object that knows about this  
path and then subscribe that.


> ...and, from there, how to make it so a ZCatalog could have a tab  
> saying "subscribe to the following events"...

 From there you wouldn't need that.  The subscriber that you  
registered in ZCML would notify the catalog.

To see an example, look at  
zope.app.catalog.catalog.indexDocSubscriber and the way it is  
registered in ZCML.

Jim

--
Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org





More information about the Zope3-dev mailing list