zopefoundation / Products.PluggableAuthService

Pluggable Zope authentication / authorization framework
Other
9 stars 18 forks source link

addPrincipalToGroup/removePrincipalFromGroup events #17

Closed gbastien closed 4 years ago

gbastien commented 6 years ago

Hi everybody,

I would like to add relevant events when a principal is added to a group or removed from a group.

Does that see correct to you, or is there another existing way to detect such changes?

Thank you for feedback,

Gauthier

davisagli commented 6 years ago

Keep in mind that groups can be provided by arbitrary criteria, such as a lookup to an external system or dynamic conditions. So this event could be fired from particular group plugins such as the ZODBGroupManager, but it wouldn't necessarily include all changes.

gbastien commented 6 years ago

Hi @davisagli

thank your for your response, in our use case, it would work ;-) because we do never use groups from external systems like LDAP, only user authentication. But I understand that in some case it would not work and something else should be setup.

Maybe we could name the events like PrincipalAddedToZODBGroup/PrincipalRemovedFromZODBGroup so it is clear?

Thank you for your feedback,

Gauthier

davisagli commented 6 years ago

I think I would keep the name generic and just be sure to document that you can't assume all group providers will fire the event.

gbastien commented 6 years ago

@davisagli ok I will propose a PR and we can make it fit.

Thank you,

Gauthier

ezvirtual commented 6 years ago

Hi @gbastien did you end up proceeding with this by any chance? I have just been looking at implementing these events and came across this issue...

Cheers

gbastien commented 6 years ago

Hi @ezvirtual

this was merged in master and 1.x branch, can you go further so #21 can be merged and a new release of 1.x can be done?

Thank you!

Gauthier

dataflake commented 4 years ago

With the merge of #58 into the 1.x branch and master and the subsequent releases of 1.11.3 and 2.2 this can be closed.