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

Examples of org.apache.directory.shared.ldap.aci.ACITuple


        MaxValueCountFilter filter = new MaxValueCountFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();

        // Test with this ACI :
        //
        tuples.add( new ACITuple(
            EMPTY_USER_CLASS_COLLECTION,
            AuthenticationLevel.NONE,
            PROTECTED_ITEMS,
            EMPTY_MICRO_OPERATION_SET,
            true,
View Full Code Here


    public void testOneTuple() throws Exception
    {
        HighestPrecedenceFilter filter = new HighestPrecedenceFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();

        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true, 10 ) );
        tuples = Collections.unmodifiableCollection( tuples );

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

    {
        final int MAX_PRECEDENCE = 10;
        HighestPrecedenceFilter filter = new HighestPrecedenceFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();

        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true,
            MAX_PRECEDENCE ) );
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true,
            MAX_PRECEDENCE / 2 ) );
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true,
            MAX_PRECEDENCE ) );
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true,
            MAX_PRECEDENCE / 3 ) );

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

    @Test
    public void testWrongScope() throws Exception
    {
        RestrictedByFilter filter = new RestrictedByFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PI_EMPTY_COLLECTION, MO_EMPTY_SET,
            true, 0 ) );

        tuples = Collections.unmodifiableCollection( tuples );

        AciContext aciContext = new AciContext( null, null );
View Full Code Here

    @Test
    public void testDenialTuple() throws Exception
    {
        RestrictedByFilter filter = new RestrictedByFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, MO_EMPTY_SET, false,
            0 ) );

        tuples = Collections.unmodifiableCollection( tuples );

        AciContext aciContext = new AciContext( null, null );
View Full Code Here

    public void testGrantTuple() throws Exception
    {
        RestrictedByFilter filter = new RestrictedByFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
        tuples
            .add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, MO_EMPTY_SET, true, 0 ) );

        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setAttributeType( SN_AT );
        aciContext.setAttrValue( new StringValue( "1" ) );
View Full Code Here

        }

        // Remove all tuples whose precedences are not the maximum one.
        for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext(); )
        {
            ACITuple tuple = i.next();

            if ( ( tuple.getPrecedence() != null ) && ( tuple.getPrecedence() != maxPrecedence ) )
            {
                i.remove();
            }
        }
View Full Code Here

            return aciContext.getAciTuples();
        }

        for ( Iterator<ACITuple> ii = aciContext.getAciTuples().iterator(); ii.hasNext(); )
        {
            ACITuple tuple = ii.next();

            if ( !tuple.isGrant() )
            {
                continue;
            }

            if ( isRemovable( tuple, aciContext.getAttributeType(), aciContext.getAttrValue(), aciContext.getEntry() ) )
View Full Code Here

            return aciContext.getAciTuples();
        }

        for ( Iterator<ACITuple> ii = aciContext.getAciTuples().iterator(); ii.hasNext(); )
        {
            ACITuple tuple = ii.next();

            if ( tuple.isGrant() )
            {
                if ( !isRelated( aciContext.getUserGroupNames(),
                    aciContext.getUserDn(),
                    userEntry,
                    aciContext.getEntryDn(),
                    tuple.getUserClasses() )
                    || aciContext.getAuthenticationLevel().compareTo( tuple.getAuthenticationLevel() ) < 0 )
                {
                    ii.remove();
                }
            }
            else
            // Denials
            {
                if ( !isRelated( aciContext.getUserGroupNames(),
                    aciContext.getUserDn(),
                    userEntry,
                    aciContext.getEntryDn(),
                    tuple.getUserClasses() )
                    && aciContext.getAuthenticationLevel().compareTo( tuple.getAuthenticationLevel() ) >= 0 )
                {
                    ii.remove();
                }
            }
        }
View Full Code Here

            return aciContext.getAciTuples();
        }

        for ( Iterator<ACITuple> i = aciContext.getAciTuples().iterator(); i.hasNext(); )
        {
            ACITuple tuple = i.next();

            if ( !isRelated( tuple, scope, aciContext.getUserDn(), aciContext.getEntryDn(),
                aciContext.getAttributeType(), aciContext.getAttrValue(), aciContext.getEntry() ) )
            {
                i.remove();
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.aci.ACITuple

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.