Package org.apache.directory.shared.ldap.name

Examples of org.apache.directory.shared.ldap.name.DN


            + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, "
            + "userPermissions { { " + "protectedItems {entry, allUserAttributeTypesAndValues}, "
            + "grantsAndDenials { grantRead, grantReturnDN, grantBrowse } } } } }" );

        // check and see if we can access the subentry now
        assertNotNull( checkCanSearhSubentryAs( "billyd", "billyd", new DN( "ou=phoneBook,uid=billyd,ou=users" ) ) );

        // 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( checkCanSearhSubentryAs( "billyd", "billyd", new DN( "ou=phoneBook,uid=billyd,ou=users" ) ) );
    }
View Full Code Here


        // The description
        attributes.put( "m-description", "Account Status" );
       
        // Inject the AT
        DN dn = new DN( "ou=attributeTypes,cn=apachemeta" );
        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
       
        getSchemaContext( service ).createSubcontext( dn, attributes );
       
        //--------------------------------------------------------------------
        // The extendPerson OC
        //--------------------------------------------------------------------
        attributes = new BasicAttributes( true );
         objectClassAttribute = new BasicAttribute( "objectClass" );
       
        objectClassAttribute.add( "top" );
        objectClassAttribute.add( "metaTop" );
        objectClassAttribute.add( "metaObjectClass" );
       
        attributes.put( objectClassAttribute );
       
        attributes.put( "m-oid", "2.16.840.1.113730.3.2.22" );
       
        // The name
        attributes.put( "m-name", "extendPerson" );
       
        // The Obsolete flag
        attributes.put( "m-obsolete", "FALSE" );
       
        // The Type list
        attributes.put( "m-typeObjectClass", "STRUCTURAL" );

        // The superiors
        attributes.put( "m-supObjectClass", "inetOrgPerson" );

        // The description
        attributes.put( "m-description", "Extended InetOrgPerson" );
       
        // The MAY list
        attributes.put( "m-may", "accountStatus" );
       
        // Inject the OC
        dn = new DN( "ou=objectClasses,cn=apachemeta" );
        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
       
        getSchemaContext( service ).createSubcontext( dn, attributes );
    }
View Full Code Here

     * @return the dn of the objectClass container
     * @throws NamingException on error
     */
    private DN getObjectClassContainer( String schemaName ) throws NamingException
    {
        return new DN( "ou=objectClasses,cn=" + schemaName );
    }
View Full Code Here

        attributes.put( "m-oid", "testOID" );
       
        // This name is invalid
        attributes.put( "m-name", "http://example.com/users/accounts/L0" );
       
        DN dn = getObjectClassContainer( "apachemeta" );
        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
       
        try
        {
            getSchemaContext( service ).createSubcontext( dn, attributes );
            fail(); // Should not reach this point
View Full Code Here

        attributes.put( "m-oid", "testOID" );
       
        // This name is invalid
        attributes.put( "m-name", "no-objectClasses" );
       
        DN dn = getObjectClassContainer( "apachemeta" );
        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
       
        try
        {
            getSchemaContext( service ).createSubcontext( dn, attributes );
            fail(); // Should not reach this point
View Full Code Here

            // We have a problem with the DN : we can't use the UpName,
            // as we may have some spaces around the ',' and '+'.
            // So we have to take the RDN one by one, and create a
            // new DN with the type and value UP form
           
            DN urlDn = (DN)ldapUrl.getDn().addAll( childDn );
           
            ldapUrl.setDn( urlDn );
            urls.add( ldapUrl.toString() );
        }
       
View Full Code Here

                    // We have a problem with the DN : we can't use the UpName,
                    // as we may have some spaces around the ',' and '+'.
                    // So we have to take the RDN one by one, and create a
                    // new DN with the type and value UP form
                   
                    DN urlDn = (DN)ldapUrl.getDn().addAll( childDn );
                   
                    ldapUrl.setDn( urlDn );
                }
               
                urlString.append( ldapUrl.toString() ).append( "??" );
View Full Code Here

        push( opContext );
       
        try
        {
            // Normalize the opContext DN
            DN dn = opContext.getDn();
            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            if ( directoryService.getReferralManager().hasParentReferral( dn ) )
            {
                ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );

                // Depending on the Context.REFERRAL property value, we will throw
                // a different exception.
                if ( opContext.isReferralIgnored() )
                {
View Full Code Here

        push( opContext );
       
        try
        {
            // Normalize the opContext DN
            DN dn = opContext.getDn();
            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            // Check if we have an ancestor for this DN
            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

        push( opContext );
       
        try
        {
            // Normalize the opContext DN
            DN dn = opContext.getDn();
            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );

            // We have to deal with the referral first
            directoryService.getReferralManager().lockRead();

            ServerEntry parentEntry = directoryService.getReferralManager().getParentReferral( dn );
           
            if ( parentEntry != null )
            {
                // We have found a parent referral for the current DN
                DN childDn = (DN)dn.getSuffix( parentEntry.getDn().size() );
   
                if ( directoryService.getReferralManager().isReferral( dn ) )
                {
                    // This is a referral. We can delete it if the ManageDsaIt flag is true
                    // Otherwise, we just throw a LdapReferralException
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.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.