Skip to content

Search Sub Groups. #15

@jamesmr89

Description

@jamesmr89

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions