zopefoundation / Products.PluggableAuthService

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

Using new IPrincipalAddedToGroupEvent event #71

Closed sgeulette closed 3 years ago

sgeulette commented 4 years ago

Hi,

I have defined a subscriber for this event. I call some code that take into account groups users using "api.user.get_users(groupname=XXX)" on each group. But the new added user is not yet found at this moment.

Is it possible to notify added user later in code ? So a "api.user.get_users(groupname=XXX)" will work...

Kind regards

dataflake commented 4 years ago

I have changed the order of calls in https://github.com/zopefoundation/Products.PluggableAuthService/commit/b5d2b8feb196f8ac08425dcff989ae21bb8c8ae1 to clear the internal caches before sending the event. Can you test the current master code?

sgeulette commented 4 years ago

I had already test it but it doesn't work.

dataflake commented 4 years ago

I have done some manual testing using just the PluggableAuthService API itself and have found that the new user is found in the group. So it feels like this issue is not in PluggableAuthService.

I don't know those APIs are you mention ("api.user.xxx"). I am guessing this is a Plone thing? I don't use Plone so I can't help you there.

sgeulette commented 4 years ago

Thanks for your test. I will investigate further.

dataflake commented 3 years ago

Closing after 10 months of inactivity, this is most likely on the Plone side. Feel free to re-open if there is a problem in this package.