[Zope3-dev] Mini-proposal: zope.app.authentication group events
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sun Feb 5 09:23:23 EST 2006
On Thursday 12 January 2006 14:11, Gary Poster wrote:
> Problem:
> We want to perform actions when a user is added to a group, and
> possibly when a user is removed from a group. There is no hook point
> for this currently in the zope.app.authentication code.
>
> Solution:
> Fire events in the zope.app.authentication code when principals are
> added and removed from groups.
>
> ----8<----8<----
> from zope import interface
>
> 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')
>
> ----8<----8<----
>
> In terms of implementation, it looks like
> zope.app.authentication.groupfolder.GroupFolder._addPrincipalToGroup
> and
> zope.app.authentication.groupfolder.GroupFolder._removePrincipalFromGrou
> p are the methods that would fire the events.
For what it is still worth, +1.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-dev
mailing list