LdapDN userName = principal.getJndiName(); if ( userName.toString().equalsIgnoreCase( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ) || !enabled )
LdapDN principalDn = principal.getJndiName();  if ( isPrincipalAnAdministrator( principalDn ) || !enabled )
    public LdapDN getMatchedName ( NextInterceptor next, LdapDN dn ) throws NamingException    {        // Access the principal requesting the operation, and bypass checks if it is the admin        Invocation invocation = InvocationStack.getInstance().peek();        PartitionNexusProxy proxy = invocation.getProxy();        LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();        LdapDN userName = principal.getJndiName();        if ( userName.toString().equalsIgnoreCase( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ) || !enabled )        {            return next.getMatchedName( dn );        }        // get the present matched name        Attributes entry;        LdapDN matched = next.getMatchedName( dn );        // check if we have disclose on error permission for the entry at the matched dn        // if not remove rdn and check that until nothing is left in the name and return        // that but if permission is granted then short the process and return the dn        while ( matched.size() > 0 )        {            entry = proxy.lookup( matched, PartitionNexusProxy.GETMATCHEDDN_BYPASS );            Set userGroups = groupCache.getGroups( userName.toString() );            Collection tuples = new HashSet();            addPerscriptiveAciTuples( proxy, tuples, matched, entry );            addEntryAciTuples( tuples, entry );            addSubentryAciTuples( proxy, tuples, matched, entry );            if ( engine.hasPermission( proxy, userGroups, userName, principal.getAuthenticationLevel(), matched, null,                null, MATCHEDNAME_PERMS, tuples, entry ) )            {                return matched;            }            matched.remove( matched.size() - 1 );        }        return matched;    }