Package org.apache.directory.api.ldap.model.name

Examples of org.apache.directory.api.ldap.model.name.Dn


                "    } " +
                "  } " +
                "}" );
   
        // check and see if we can access the subentry now
        assertNotNull( checkCanSearchSubentryAs( "billyd", "billyd", new Dn( "cn=anybodySearch,ou=system" ) ) );
   
        // now add a denial to prevent all users except the admin from accessing the subentry
        addSubentryACI(
        "{ " +
            "  identificationTag \"searchAci\", " +
            "  precedence 14, " +
            "  authenticationLevel none, " +
            "  itemOrUserFirst userFirst: " +
            "  { " +
            "    userClasses { allUsers }, " +
            "    userPermissions " +
            "    { " +
            "      { " +
            "        protectedItems {entry, allUserAttributeTypesAndValues}, " +
            "        grantsAndDenials { denyRead, denyReturnDN, denyBrowse } " +
            "      } " +
            "    } " +
            "  } " +
            "}" );
   
        // now we should not be able to access the subentry with a search
        assertNull( checkCanSearchSubentryAs( "billyd", "billyd", new Dn( "cn=anybodySearch,ou=system" ) ) );
    }
View Full Code Here


                "    } " +
                "  } " +
                "}" );
   
        // check and see if we can access the subentry now
        assertNotNull( checkCanSearchSubentryAs( "billyd", "billyd", new Dn(
            "ou=phoneBook,uid=billyd,ou=users,ou=system" ) ) );
   
        // now add a denial to prevent all users except the admin from accessing the subentry
        addPrescriptiveACI( "anybodySearchTheirSubordinates",
            "{ " +
                "  identificationTag \"anybodyDontSearchTheirSubordinates\", " +
                "  precedence 14, " +
                "  authenticationLevel none, " +
                "  itemOrUserFirst userFirst: " +
                "  { " +
                "    userClasses { parentOfEntry }, " +
                "    userPermissions " +
                "    { " +
                "      { " +
                "        protectedItems {entry, allUserAttributeTypesAndValues}, " +
                "        grantsAndDenials { denyRead, denyReturnDN, denyBrowse } " +
                "      } " +
                "    } " +
                "  } " +
                "}" );
   
        // now we should not be able to access the subentry with a search
        assertNull( checkCanSearchSubentryAs( "billyd", "billyd", new Dn( "ou=phoneBook,uid=billyd,ou=users,ou=system" ) ) );
    }
View Full Code Here

        if ( principalDn == null )
        {
            principalDn = "";
        }

        Dn userDn = new Dn( service.getSchemaManager(), principalDn );
        LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE );

        if ( dn == null )
        {
            dn = "";
View Full Code Here

    @Test
    public void testAddEntryNonExistingAT() throws Exception
    {
        LdapConnection connection = getAdminConnection( getLdapServer() );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry();
        personEntry.add( SchemaConstants.OBJECT_CLASS_AT, "person" );
        personEntry.add( SchemaConstants.CN_AT, "Kate Bush" );
        personEntry.add( SchemaConstants.SN_AT, "Bush" );
View Full Code Here

    @Test(expected = LdapOperationException.class)
    public void testAddEntryNonExistingOC() throws Exception
    {
        LdapConnection connection = getAdminConnection( getLdapServer() );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry();
        personEntry.add( SchemaConstants.OBJECT_CLASS_AT, "nonexistingOC" );
        personEntry.add( SchemaConstants.CN_AT, "Kate Bush" );
        personEntry.add( SchemaConstants.SN_AT, "Bush" );
View Full Code Here

            dataBytes[i] = 'A';
        }

        String data = Strings.utf8ToString( dataBytes );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry( "cn=Kate Bush," + BASE,
            "objectClass: top",
            "objectClass: person",
            "cn: Kate Bush",
View Full Code Here

    @Test
    public void testRename() throws Exception
    {
        connection.rename( DN, "cn=modifyDnWithString" );
        Entry entry = session.lookup( new Dn( "cn=modifyDnWithString,ou=system" ), "*" );
        assertTrue( session.exists( new Dn( "cn=modifyDnWithString,ou=system" ) ) );
        assertTrue( entry.contains( "cn", "modifyDnWithString" ) );
        assertFalse( entry.contains( "cn", "modDn" ) );
    }
View Full Code Here

    @Test
    public void testRenameWithoutDeleteOldRdn() throws Exception
    {
        connection.rename( DN, "cn=modifyDnWithString", false );

        Dn oldDn = new Dn( DN );
        assertFalse( session.exists( oldDn ) );

        Entry entry = session.lookup( new Dn( "cn=modifyDnWithString,ou=system" ) );
        assertNotNull( entry );

        Rdn oldRdn = oldDn.getRdn();
        assertTrue( entry.contains( oldRdn.getType(), oldRdn.getNormValue() ) );
    }
View Full Code Here

    @Test
    public void testMove() throws Exception
    {
        connection.move( DN, "ou=users,ou=system" );

        Dn oldDn = new Dn( DN );
        assertFalse( session.exists( oldDn ) );

        assertTrue( session.exists( new Dn( "cn=modDn,ou=users,ou=system" ) ) );
    }
View Full Code Here


    @Test
    public void testMoveAndRename() throws Exception
    {
        Dn origDn = new Dn( "cn=testadd,ou=users,ou=system" );
        Entry entry = new DefaultEntry( origDn );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
        entry.add( SchemaConstants.CN_AT, "testadd" );
        entry.add( SchemaConstants.SN_AT, "testadd_sn" );

        connection.add( entry );

        Dn newDn = new Dn( "cn=testaddMovedAndRenamed,ou=system" );
        connection.moveAndRename( origDn, newDn );

        assertFalse( session.exists( origDn ) );

        entry = session.lookup( newDn, "+" );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.name.Dn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.