Unless your an LDAP expert it’s not obvious how to find the groups a user is member of, and that also describes how you need to tackle this problem.
This code makes a lot of assumptions and also assumes that a user’s UID is named ‘uid’.
If there’s a better way to do this, let me know.
This thread on the Python-LDAP mailing list was quite useful:
- Photo is one I took in 2007 at Fort Point in Boston.