private String resolveAmbariAdminAttrFilter(LdapServerProperties ldapServerProperties, String memberValue) {
    String groupMembershipAttr = ldapServerProperties.getGroupMembershipAttr();
    String groupObjectClass = ldapServerProperties.getGroupObjectClass();
    String adminGroupMappingRules =
        ldapServerProperties.getAdminGroupMappingRules();
    final String groupNamingAttribute =
        ldapServerProperties.getGroupNamingAttr();
    String groupSearchFilter = ldapServerProperties.getGroupSearchFilter();

    String setAmbariAdminAttrFilter;
    if (StringUtils.isEmpty(groupSearchFilter)) {
      String adminGroupMappingRegex = createAdminGroupMappingRegex(adminGroupMappingRules, groupNamingAttribute);
      setAmbariAdminAttrFilter = String.format("(&(%s=%s)(objectclass=%s)(|%s))",
          groupMembershipAttr,
          memberValue,
          groupObjectClass,
          adminGroupMappingRegex);
    } else {
      setAmbariAdminAttrFilter = String.format("(&(%s=%s)%s)",
          groupMembershipAttr,
          memberValue,
          groupSearchFilter);
    }
    return setAmbariAdminAttrFilter;
  }
Checks weather user is a member of ambari administrators group in LDAP. If
yes, sets user's ambari_admin attribute to true

@param user the user details
@return the updated user details
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java