code: public Map<String, User> getUsers(LDAPConnection ldapConnection)
              throws GuacamoleException {
  
          // Retrieve all visible user objects
          Collection<String> attributes = confService.getUsernameAttributes();
          List<LDAPEntry> results = queryService.search(ldapConnection,
                  confService.getUserBaseDN(),
                  confService.getUserSearchFilter(),
                  attributes,
                  null);
  
          // Convert retrieved users to map of identifier to Guacamole user object
          return queryService.asMap(results, entry -> {
  
              // Get username from record
              String username = queryService.getIdentifier(entry, attributes);
              if (username == null) {
                  logger.warn("User \"{}\" is missing a username attribute "
                          + "and will be ignored.", entry.getDN());
                  return null;
              }
  
              return new SimpleUser(username);
  
          });
  
      }
docs: Returns all Guacamole users accessible to the user currently bound under
  the given LDAP connection.
  
  @param ldapConnection
  The current connection to the LDAP server, associated with the
  current user.
  
  @return
  All users accessible to the user currently bound under the given
  LDAP connection, as a map of connection identifier to corresponding
  user object.
  
  @throws GuacamoleException
  If an error occurs preventing retrieval of users.