Skip to content
Permalink
Browse files
Allowing filtering of LDAP groups
  • Loading branch information
mjaggard committed Oct 23, 2015
1 parent 7142138 commit e546fe3bc0c08ecc022e421058abb97f06b7acc4
Showing 2 changed files with 11 additions and 0 deletions.
@@ -92,6 +92,8 @@

private String groupsDn;

private String groupFilter;

private String baseDn;

private String ldapGroupMember = "uniquemember";
@@ -120,6 +122,8 @@ public void initialize()
this.groupsDn = this.baseDn;
}

this.groupFilter = userConf.getString( UserConfigurationKeys.LDAP_GROUPS_FILTER, this.groupFilter );

this.useDefaultRoleName =
userConf.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, this.useDefaultRoleName );

@@ -145,6 +149,11 @@ public List<String> getAllGroups( DirContext context )

String filter = "objectClass=" + getLdapGroupClass();

if ( !StringUtils.isEmpty( this.groupFilter ) )
{
filter = "&(" + filter + ")(" + this.groupFilter + ")";
}

namingEnumeration = context.search( getGroupsDn(), filter, searchControls );

List<String> allGroups = new ArrayList<String>();
@@ -84,6 +84,8 @@

String LDAP_GROUPS_BASEDN = "ldap.config.groups.base.dn";

String LDAP_GROUPS_FILTER = "ldap.config.groups.filter";

String LDAP_GROUPS_MEMBER = "ldap.config.groups.member";

String LDAP_GROUPS_ROLE_START_KEY = "ldap.config.groups.role.";

0 comments on commit e546fe3

Please sign in to comment.