2

When assigning a user to a group, is it possible to call a subscriber? Are there available events to this action? If so, in which product?

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251

1 Answers1

3

No. It does not appear that Products.PluggableAuthService.plugins.ZODBGroupManager.ZODBGroupManager.addPrincipalToGroup nor anything that calls it notifies any event.

I would suggest that if you have an add-on that needs this:

(1) Submit a feature request ticket at https://dev.plone.org -- it would be nice to have this, I am pretty sure that I could use it too.

(2) For now, have your add-on monkey patch ZODBGroupManager.addPrincipalToGroup() method wrapping the original function with an event notification of your own devising called after the user is added to the group. https://stackoverflow.com/search?q=monkey+patch+python

Community
  • 1
  • 1
sdupton
  • 1,869
  • 10
  • 9
  • 1
    Yes, PAS still does not do this now. You are always welcome to either monkey patch or sign Zope Foundation contributor agreement if you wish to submit an improvement via github pull request. https://github.com/zopefoundation/Products.PluggableAuthService/blob/master/Products/PluggableAuthService/plugins/ZODBGroupManager.py#L267 – sdupton Jul 08 '15 at 16:56