[Zope3-dev] Re: Mini-proposal: zope.app.authentication group events

2006-01-12 Thread Gary Poster


On Jan 12, 2006, at 7:18 PM, Florent Guillaume wrote:


Gary Poster wrote:

On Jan 12, 2006, at 2:11 PM, Gary Poster wrote:

def IPrincipalAddedToGroup(interface.Inteface):
group = interface.Attribute('the group to which the  
principal  was added')

principal = interface.Attribute('the principal added')

def IPrincipalRemovedFromGroup(interface.Inteface):
group = interface.Attribute('the group from which the  
principal  was removed')

principal = interface.Attribute('the principal removed')
Small change: clarify that these are ids, and allow multiple   
principals to be specified.

def IPrincipalAddedToGroup(interface.Inteface):
group_id = interface.Attribute('the id of the group to which  
the  principal was added')
principal_ids = interface.Attribute('an iterable of one or  
more  ids of principals added')

def IPrincipalRemovedFromGroup(interface.Inteface):
group_id = interface.Attribute('the id of the group from  
which  the principal was removed')
principal_ids = interface.Attribute('an iterable of one or  
more  ids of principals removed')


+1


Cool.


But why the ids and not the objects themselves?


It's driven by the interfaces and implementations around it .  Since  
Zope 3 generates the principal objects on the fly and actually only  
manipulates principal ids for the persistent data, a number of  
situations will not have objects already created for the pertinent  
principals.  Therefore this is just what falls out naturally.



Wouldn't it allow for more flexibility?


You can always convert an id to a principal (if it's a valid id) so I  
don't think so.


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: Mini-proposal: zope.app.authentication group events

2006-01-12 Thread Florent Guillaume

Gary Poster wrote:


On Jan 12, 2006, at 2:11 PM, Gary Poster wrote:


def IPrincipalAddedToGroup(interface.Inteface):
group = interface.Attribute('the group to which the principal  was 
added')

principal = interface.Attribute('the principal added')

def IPrincipalRemovedFromGroup(interface.Inteface):
group = interface.Attribute('the group from which the principal  
was removed')

principal = interface.Attribute('the principal removed')



Small change: clarify that these are ids, and allow multiple  principals 
to be specified.


def IPrincipalAddedToGroup(interface.Inteface):
group_id = interface.Attribute('the id of the group to which the  
principal was added')
principal_ids = interface.Attribute('an iterable of one or more  ids 
of principals added')


def IPrincipalRemovedFromGroup(interface.Inteface):
group_id = interface.Attribute('the id of the group from which  the 
principal was removed')
principal_ids = interface.Attribute('an iterable of one or more  ids 
of principals removed')


+1

But why the ids and not the objects themselves? Wouldn't it allow for 
more flexibility?


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com