将组分配给用户时的订阅者
将用户分配到组时,是否可以调用订阅者?此操作是否有可用的事件 ?如果有,在哪个产品中?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。Products.PluggableAuthService.plugins.ZODBGroupManager.ZODBGroupManager.addPrincipalToGroup 或调用它的任何内容似乎都不会通知任何事件。
我建议,如果您有需要此功能的附加组件:
(1) 在 https:// 提交功能请求票证dev.plone.org——如果有这个就好了,我很确定我也可以使用它。
(2) 现在,让您的附加猴子补丁 ZODBGroupManager.addPrincipalToGroup() 方法包装原始函数,并在用户添加到组后调用您自己设计的事件通知。 https://stackoverflow.com/search?q=monkey+patch+python
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