Examples of containsRole()


Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

                   ? Interceptor.CONTINUE
                   : Interceptor.SKIP;
        }

        /* Check the roles */
        else if ( descr.containsRole( Constants.ALL ) )
        {
            return Interceptor.CONTINUE;
        }
        else
        {
View Full Code Here

Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

            Collection roles = ( ( PortletRequestImpl ) request ).getUserRoles(  );
            Iterator   it = roles.iterator(  );
            while ( it.hasNext(  ) )
            {
                String role = it.next(  ).toString(  );
                if ( descr.containsRole( role ) )
                {
                    return Interceptor.CONTINUE;
                }
            }
        }
View Full Code Here

Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

        /* auth */
        AuthConstraintDescriptor auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.VIEW );
        assertNotNull( "auth[view]", auth );
        assertTrue( "auth[view].allowAnonymous", auth.isAllowAnonymous(  ) );
        assertTrue( "auth[view].role[author]", auth.containsRole( "author" ) );
        assertTrue( "auth[view].role[admin]", auth.containsRole( "admin" ) );

        auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.CONFIGURE );
        assertNotNull( "auth[configure]", auth );
        assertFalse( "auth[configure].allowAnonymous", auth.isAllowAnonymous(  ) );
View Full Code Here

Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

        /* auth */
        AuthConstraintDescriptor auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.VIEW );
        assertNotNull( "auth[view]", auth );
        assertTrue( "auth[view].allowAnonymous", auth.isAllowAnonymous(  ) );
        assertTrue( "auth[view].role[author]", auth.containsRole( "author" ) );
        assertTrue( "auth[view].role[admin]", auth.containsRole( "admin" ) );

        auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.CONFIGURE );
        assertNotNull( "auth[configure]", auth );
        assertFalse( "auth[configure].allowAnonymous", auth.isAllowAnonymous(  ) );
        assertFalse( "auth[configure].role[author]", auth.containsRole( "author" ) );
View Full Code Here

Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

        assertTrue( "auth[view].role[admin]", auth.containsRole( "admin" ) );

        auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.CONFIGURE );
        assertNotNull( "auth[configure]", auth );
        assertFalse( "auth[configure].allowAnonymous", auth.isAllowAnonymous(  ) );
        assertFalse( "auth[configure].role[author]", auth.containsRole( "author" ) );
        assertTrue( "auth[configure].role[admin]", auth.containsRole( "admin" ) );
       
        WebflowActionDescriptor wf = portlet.getWebflowAction( "view" );
        assertNotNull( "webflow[view]", wf );
        assertEquals( "webflow[view].success", "/success.jsp", wf.getReturnURI("success"));
View Full Code Here

Examples of net.sf.jportlet.portlet.descriptor.AuthConstraintDescriptor.containsRole()

        auth = portlet.getAuthConstraintDescriptor( Portlet.Mode.CONFIGURE );
        assertNotNull( "auth[configure]", auth );
        assertFalse( "auth[configure].allowAnonymous", auth.isAllowAnonymous(  ) );
        assertFalse( "auth[configure].role[author]", auth.containsRole( "author" ) );
        assertTrue( "auth[configure].role[admin]", auth.containsRole( "admin" ) );
       
        WebflowActionDescriptor wf = portlet.getWebflowAction( "view" );
        assertNotNull( "webflow[view]", wf );
        assertEquals( "webflow[view].success", "/success.jsp", wf.getReturnURI("success"));
        assertEquals( "webflow[view].input", "/portlet/capital/mode/view/state/maximized", wf.getReturnURI("input"));
View Full Code Here

Examples of org.apache.avalon.fortress.MetaInfoEntry.containsRole()

        try
        {
            MetaInfoEntry entry = new MetaInfoEntry( m_componentClass, m_properties, m_dependencies );
            entry.addRole( Role1.class.getName() );
            entry.containsRole( null );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
View Full Code Here

Examples of org.apache.avalon.fortress.MetaInfoEntry.containsRole()

        assertEquals( "componentClass:",
            metaEntry.getComponentClass(), Class.forName( className ) );

        for ( int i = 0; i < roles.length; i++ )
        {
            assertTrue( "Role:", metaEntry.containsRole( roles[i] ) );
        }
        assertEquals( "Handler:",
            metaEntry.getHandlerClass(), Class.forName( handlerClassname ) );
    }
}
View Full Code Here

Examples of org.apache.avalon.fortress.MetaInfoEntry.containsRole()

        assertEquals( "componentClass:",
            metaEntry.getComponentClass(), Class.forName( className ) );

        for ( int i = 0; i < roles.length; i++ )
        {
            assertTrue( "Role:", metaEntry.containsRole( roles[i] ) );
        }
        assertEquals( "Handler:",
            metaEntry.getHandlerClass(), Class.forName( handlerClassname ) );
    }
}
View Full Code Here

Examples of org.apache.avalon.fortress.MetaInfoEntry.containsRole()

        try
        {
            MetaInfoEntry entry = new MetaInfoEntry( m_componentClass, m_properties, m_dependencies );
            entry.addRole( Role1.class.getName() );
            entry.containsRole( null );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
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.