public Set < String > getParentUserGroupIdentifiers ( LDAPConnection ldapConnection , String userDN ) throws GuacamoleException { Collection < String > attributes = confService . getGroupNameAttributes ( ) ; List < LDAPEntry > userGroups = getParentUserGroupEntries ( ldapConnection , userDN ) ; Set < String > identifiers = new HashSet <> ( userGroups . size ( ) ) ; userGroups . forEach ( entry -> { // Determine unique identifier for user group String name = queryService . getIdentifier ( entry , attributes ) ; if ( name != null ) identifiers . add ( name ) ; // Ignore user groups which lack a name attribute else logger . debug ( "User group \"{}\" is missing a name attribute " + "and will be ignored." , entry . getDN ( ) ) ; } ) ; return identifiers ; }
Returns the identifiers of all user groups that the given user is a member of . Only identifiers of user groups which are readable by the current user will be retrieved .