Package net.sf.jportlet.portlet.descriptor

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


            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

        /* 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

        /* 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

        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

        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

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.