LdapPrincipal user = ( ( ServerContext ) invocation.getCaller() ).getPrincipal(); if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal(); Name userName = dnParser.parse( principal.getName() );  if ( userName.toString().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )
    public boolean compare( NextInterceptor next, Name name, String oid, Object value ) throws NamingException    {        // Access the principal requesting the operation, and bypass checks if it is the admin        Invocation invocation = InvocationStack.getInstance().peek();        DirectoryPartitionNexusProxy proxy = invocation.getProxy();        Attributes entry = proxy.lookup( name, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );        LdapPrincipal user = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )        {            return next.compare( name, oid, value );        }        Set userGroups = groupCache.getGroups( user.getName() );        Collection tuples = new HashSet();        addPerscriptiveAciTuples( proxy, tuples, name, entry );        addEntryAciTuples( tuples, entry );        addSubentryAciTuples( proxy, tuples, name, entry );        engine.checkPermission( proxy, userGroups, user.getJndiName(), user.getAuthenticationLevel(), name, null,                null, READ_PERMS, tuples, entry );        engine.checkPermission( proxy, userGroups, user.getJndiName(), user.getAuthenticationLevel(), name, oid,                value, COMPARE_PERMS, tuples, entry );        return next.compare( name, oid, value );    }