Examples of RestrictedByItem


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

                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

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

        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

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

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

        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

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

    {
        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

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

                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

Examples of org.apache.ldap.common.aci.ProtectedItem.RestrictedByItem

    }
   
    public void testRestrictedBy() throws Exception
    {
        Collection rbItems = new ArrayList();
        rbItems.add( new RestrictedByItem( "attrA", "attrB" ) );
        Collection tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) );

        // Test wrong scope
        Assert.assertEquals(
                0, filterA.filter(
View Full Code Here

Examples of org.apache.ldap.common.aci.ProtectedItem.RestrictedByItem

            if( item instanceof ProtectedItem.RestrictedBy )
            {
                ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
                for( Iterator k = rb.iterator(); k.hasNext(); )
                {
                    RestrictedByItem rbItem = ( RestrictedByItem ) k.next();
                    if( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
                    {
                        Attribute attr = entry.get( rbItem.getValuesIn() );
                        if( attr == null || !attr.contains( attrValue ) )
                        {
                            return true;
                        }
                    }
View Full Code Here

Examples of org.apache.ldap.common.aci.ProtectedItem.RestrictedByItem

                }

                ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
                for( Iterator j = rb.iterator(); j.hasNext(); )
                {
                    RestrictedByItem rbItem = ( RestrictedByItem ) j.next();
                    if( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
                    {
                        return true;
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.