DirContext userContext = getUserContext( userName, "billyd" );
DirContext userContext = getContextAs( userName, password );
    public boolean checkCanAddEntryAs( String uid, String password, String entryRdn ) throws NamingException    {        // try an add operation which should fail without any ACI        Attributes testEntry = new BasicAttributes( "ou", "testou", true );        Attribute objectClass = new BasicAttribute( "objectClass" );        testEntry.put( objectClass );        objectClass.add( "top" );        objectClass.add( "organizationalUnit" );        try        {            LdapName userName = new LdapName( "uid="+uid+",ou=users,ou=system" );            DirContext userContext = getUserContext( userName, "billyd" );            userContext.createSubcontext( entryRdn, testEntry );            // delete the newly created context as the admin user            DirContext adminContext = getAdminContext();            adminContext.destroySubcontext( entryRdn );            return true;        }        catch ( LdapNoPermissionException e )        {            return false;        }    }