node-ldapauth icon indicating copy to clipboard operation
node-ldapauth copied to clipboard

Search Sub Groups.

Open jamesmr89 opened this issue 12 years ago • 0 comments

I took over some code so bare with me here, just trying to figure this out:

we are using version 2.2.2:

This works, however if a user is a member of a group that is a subgroup, we aren't able to determine that, is there a way to specify that we want to expand the memberof to include the subgroups that he/she belongs to?

var approved = 0; ldapconfig.permittedGroups.forEach(function(p) { user.memberOf.forEach(function(g) { console.log(g); if(g == p.group) { console.log('Hey this group matched!!!'); // Choose the smallest non-zero value encountered if(!approved || (approved > p.security)) { approved = p.security; } console.log(creds.username + " in approved group " + p.group + " with security " + p.security); } }); });

Right now I only get the groups this user is spefically a member of, if he/she is a member of a child group of another group we never know with this code. Is there a better/easier way to determine what parent groups the user is a member of?

Thanks in advance.

jamesmr89 avatar Oct 22 '13 18:10 jamesmr89