Open ramonski opened 7 years ago
get_user()
method works, but it uses a different method to "hunt" the users in the user folders.
While get_users()
fails to list LDAP users, but the problem is in the underlying method here:
When pas.plugins.ldap
add-on is activated, the ṗortal_membership.listMembers
returns an empty list. It is not PAS plug-in aware.
A workaround would be:
md = getToolByName(api.portal.get(), 'portal_memberdata')
pm = getToolByName(api.portal.get(), 'portal_membership')
return all_members = [pm.getMemberById(userid) for userid in md._members.keys()]
Although I'm not sure if it is the fastest one.
Hi @szakitibi, thanks for pointing this code out! We'll probably use your code it in our own API unless we find a better way to do it: https://github.com/senaite/senaite.core/blob/master/bika/lims/api/__init__.py#L956
Description
Having LDAP in place, the
api.user.get_users()
orapi.user.get_users(ldapuserid)
mothods do not return anything, but the LDAP users get found and listed in the user and groups control panel at/@@usergroup-userprefs
.