Package org.apache.directory.shared.ldap.aci.protectedItem

Examples of org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByItem


    @Test
    public void testRestrictedBy() throws Exception
    {
        Set<RestrictedByElem> rbItems = new HashSet<RestrictedByElem>();
        rbItems.add( new RestrictedByElem( CN_AT, SN_AT ) );
        Collection<ACITuple> tuples = getTuples( new RestrictedByItem( rbItems ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new RestrictedByItem( rbItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new RestrictedByItem( rbItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
View Full Code Here


        CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
        SN_AT = schemaManager.lookupAttributeTypeRegistry( "sn" );

        Set<RestrictedByElem> mvcItems = new HashSet<RestrictedByElem>();
        mvcItems.add( new RestrictedByElem( SN_AT, CN_AT ) );
        PROTECTED_ITEMS.add( new RestrictedByItem( mvcItems ) );
    }
View Full Code Here

    {
        for ( ProtectedItem item : tuple.getProtectedItems() )
        {
            if ( item instanceof RestrictedByItem )
            {
                RestrictedByItem rb = ( RestrictedByItem ) item;

                for ( Iterator<RestrictedByElem> k = rb.iterator(); k.hasNext(); )
                {
                    RestrictedByElem rbItem = k.next();

                    // TODO Fix DIRSEVER-832
                    if ( attributeType.equals( rbItem.getAttributeType() ) )
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                RestrictedByItem rb = ( RestrictedByItem ) item;

                for ( Iterator<RestrictedByElem> j = rb.iterator(); j.hasNext(); )
                {
                    RestrictedByElem rbItem = j.next();

                    if ( oid.equals( rbItem.getAttributeType().getOid() ) )
                    {
View Full Code Here

        Set<RestrictedByElem> colC = new HashSet<RestrictedByElem>();
        colC.add( rbiB );
        colC.add( rbiC );
        colC.add( rbiD );

        restrictedByA = new RestrictedByItem( colA );
        restrictedByACopy = new RestrictedByItem( colA );
        restrictedByB = new RestrictedByItem( colB );
        restrictedByC = new RestrictedByItem( colC );
    }
View Full Code Here

    @Test
    public void testRestrictedBy() throws Exception
    {
        Set<RestrictedByElem> rbItems = new HashSet<RestrictedByElem>();
        rbItems.add( new RestrictedByElem( CN_AT, SN_AT ) );
        Collection<ACITuple> tuples = getTuples( new RestrictedByItem( rbItems ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
       
        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new RestrictedByItem( rbItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
       
        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new RestrictedByItem( rbItems ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
View Full Code Here

        CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
        SN_AT = schemaManager.lookupAttributeTypeRegistry( "sn" );

        Set<RestrictedByElem> mvcItems = new HashSet<RestrictedByElem>();
        mvcItems.add( new RestrictedByElem( SN_AT, CN_AT ) );
        PROTECTED_ITEMS.add( new RestrictedByItem( mvcItems ) );
    }
View Full Code Here

    {
        for ( ProtectedItem item : tuple.getProtectedItems() )
        {
            if ( item instanceof RestrictedByItem )
            {
                RestrictedByItem rb = ( RestrictedByItem ) item;
           
                for ( Iterator<RestrictedByElem> k = rb.iterator(); k.hasNext(); )
                {
                    RestrictedByElem rbItem = k.next();
               
                    // TODO Fix DIRSEVER-832
                    if ( attributeType.equals( rbItem.getAttributeType() ) )
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                RestrictedByItem rb = ( RestrictedByItem ) item;
               
                for ( Iterator<RestrictedByElem> j = rb.iterator(); j.hasNext(); )
                {
                    RestrictedByElem rbItem = j.next();
                   
                    if ( oid.equals( rbItem.getAttributeType().getOid() ) )
                    {
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByItem

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.