boolean isAdmin = principalDn.toNormName().equals( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED );   if ( isAdmin )
if ( isAnAdministrator( principalDn ) )
    private boolean isSearchable( Invocation invocation, SearchResult result ) throws NamingException    {        LdapDN principalDn = ( ( ServerContext ) invocation.getCaller() ).getPrincipal().getJndiName();        LdapDN dn;        dn = new LdapDN( result.getName() );        dn.normalize( oidsMap );        boolean isAdmin = principalDn.toNormName().equals( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED );                // Admin user gets full access to all entries        if ( isAdmin )        {            return true;        }                // Users reading their own entries should be allowed to see all        boolean isSelfRead = dn.toNormName().equals( principalDn.toNormName() );        if ( isSelfRead )        {            return true;        }                // Block off reads to anything under ou=users and ou=groups if not a self read        if ( dn.size() > 2 )        {            // stuff this if in here instead of up in outer if to prevent             // constant needless reexecution for all entries in other depths                        if ( dn.toNormName().endsWith( USER_BASE_DN_NORMALIZED.toNormName() )                 || dn.toNormName().endsWith( GROUP_BASE_DN_NORMALIZED.toNormName() ) )            {                return false;            }        }                // Non-admin users cannot read the admin entry        if ( dn.toNormName().equals( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ) )        {            return false;        }                return true;    }