Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Sub Groups. #15

Open
jamesmr89 opened this issue Oct 22, 2013 · 0 comments
Open

Search Sub Groups. #15

jamesmr89 opened this issue Oct 22, 2013 · 0 comments

Comments

@jamesmr89
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant