guedes / ldap_fdw

A LDAP Foreign Data Wrapper for PostgreSQL
31 stars 10 forks source link

Get all the groups of a user #17

Open martinamuscariello opened 7 years ago

martinamuscariello commented 7 years ago

I create two foreign table

CREATE FOREIGN TABLE ldap.users ( mail character varying, cn character varying, description character varying, ou character varying, distinguishedName character varying, sAMAccountName character varying, displayName character varying ) server ldap_srv options ( uri 'my_ldapserver', path 'OU=Utenti,DC=....,DC=...,DC=...', scope 'sub', binddn '............', bindpwd 'mypwd', objectClass 'user' );

CREATE FOREIGN TABLE ldap.groups( distinguishedName character varying, sAMAccountName character varying ) server ldap_srv options ( uri 'my_ldapserver', path 'OU=Utenti,DC=.....,DC=.....,DC=......', scope 'sub', binddn '............', bindpwd 'mypwd', objectClass 'group' );

ldap.users contains all users ldap.groups contains all groups

How can I get all groups a user is member of ?

Thanks in advance.