Examples of RestrictedByItem


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

            MaxImmSubItem mis = ( MaxImmSubItem ) item;
            values.add( Integer.toString( mis.getValue() ) );
        }
        else if ( item.getClass() == RestrictedByItem.class )
        {
            RestrictedByItem rb = ( RestrictedByItem ) item;
            for ( Iterator<RestrictedByElem> it = rb.iterator(); it.hasNext(); )
            {
                RestrictedByElem rbe = it.next();
                values.add( rbe.toString() );
            }
        }
View Full Code Here

Examples of org.apache.directory.api.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.api.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.api.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.api.ldap.aci.protectedItem.RestrictedByItem

        elemsC.add( new RestrictedByElem( new AttributeType( "aa" ), new AttributeType( "cc" ) ) );
        elemsD = new HashSet<RestrictedByElem>();
        elemsD.add( new RestrictedByElem( new AttributeType( "aa" ), new AttributeType( "aa" ) ) );
        elemsD.add( new RestrictedByElem( new AttributeType( "aa" ), new AttributeType( "bb" ) ) );
        elemsD.add( new RestrictedByElem( new AttributeType( "aa" ), new AttributeType( "dd" ) ) );
        restrictedByItemA = new RestrictedByItem( elemsA );
        restrictedByItemACopy = new RestrictedByItem( elemsA );
        restrictedByItemB = new RestrictedByItem( elemsB );
        restrictedByItemC = new RestrictedByItem( elemsC );
        restrictedByItemD = new RestrictedByItem( elemsD );
    }
View Full Code Here

Examples of org.apache.directory.api.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.api.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

            {
                ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
           
                for ( Iterator<RestrictedByItem> k = rb.iterator(); k.hasNext(); )
                {
                    RestrictedByItem rbItem = k.next();
               
                    // TODO Fix DIRSEVER-832
                    if ( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
                    {
                        EntryAttribute attr = entry.get( rbItem.getValuesIn() );
                       
                        // TODO Fix DIRSEVER-832
                        if ( ( attr == null ) || !attr.contains( attrValue ) )
                        {
                            return true;
View Full Code Here

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

    @Test
    public void testRestrictedBy() throws Exception
    {
        Collection<RestrictedByItem> rbItems = new ArrayList<RestrictedByItem>();
        rbItems.add( new RestrictedByItem( "cn", "sn" ) );
        Collection<ACITuple> tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems ) );

        // Test wrong scope
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null, null,
            "cn", null, null, null, null ).size() );
View Full Code Here

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

                }

                ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
                for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
                {
                    RestrictedByItem rbItem = j.next();
                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( 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.