Package org.apache.pluto.om.common

Examples of org.apache.pluto.om.common.SecurityRoleRefSet


                    servletMapping.setUrlPattern(
                        "/" + portlet.getName().replace(' ', '_') + "/*");
                    servletMappings.add(servletMapping);
                }

                SecurityRoleRefSet servletSecurityRoleRefs =
                    ((ServletDefinitionImpl)servlet).getInitSecurityRoleRefSet();

                SecurityRoleRefSetCtrl servletSecurityRoleRefSetCtrl =
                    (SecurityRoleRefSetCtrl) controllerFactory.get(
                        servletSecurityRoleRefs);

                SecurityRoleSet webAppSecurityRoles = webApp.getSecurityRoles();
                   
                SecurityRoleRefSet portletSecurityRoleRefs =
                    portlet.getInitSecurityRoleRefSet();

                Iterator p = portletSecurityRoleRefs.iterator();

                while (p.hasNext()) {
                    SecurityRoleRef portletSecurityRoleRef =
                        (SecurityRoleRef) p.next();
                   
View Full Code Here


        Collection portlets = portletApp.getPortletDefinitions();
        Iterator portletIterator = portlets.iterator();
        while (portletIterator.hasNext())
        {
            PortletDefinition portlet = (PortletDefinition) portletIterator.next();
            SecurityRoleRefSet securityRoleRefs = portlet.getInitSecurityRoleRefSet();
            Iterator roleRefsIterator = securityRoleRefs.iterator();
            while (roleRefsIterator.hasNext())
            {
                SecurityRoleRef roleRef = (SecurityRoleRef) roleRefsIterator.next();
                String roleName = roleRef.getRoleLink();
                if (roleName == null || roleName.length() == 0)
View Full Code Here

    }
   
    private String mapRoleRefToRole(String roleName)
    {
        PortletDefinition portletDefinition = portletWindow.getPortletEntity().getPortletDefinition();
        SecurityRoleRefSet roleRefSet = portletDefinition.getInitSecurityRoleRefSet();
        SecurityRoleSet roleSet = portletDefinition.getPortletApplicationDefinition().getWebApplicationDefinition()
                .getSecurityRoles();

        Iterator roleRefIter = roleRefSet.iterator();
        while (roleRefIter.hasNext())
        {
            SecurityRoleRef roleRef = (SecurityRoleRef) roleRefIter.next();
            if (roleName.equals(roleRef.getRoleName()))
            {
View Full Code Here

                TagLibImpl tagLib = new TagLibImpl();
                tagLib.setTaglibUri(WEB_PORTLET_TAGLIB_URI);
                tagLib.setTaglibLocation(WEB_PORTLET_TAGLIB_LOCATION);
                webApplicationDefinition.getTagLibs().add(tagLib);               

                SecurityRoleRefSet servletSecurityRoleRefs = ((ServletDefinitionImpl)servlet).getSecurityRoleRefs();

                SecurityRoleRefSetCtrl servletSecurityRoleRefSetCtrl = (SecurityRoleRefSetCtrl)controllerFactory.get(servletSecurityRoleRefs);

                SecurityRoleSet webAppSecurityRoles = webApplicationDefinition.getSecurityRoles();

                SecurityRoleRefSet portletSecurityRoleRefs = portlet.getInitSecurityRoleRefSet();

                //SecurityRoleRefSetCtrl portletSecurityRoleRefSetCtrl = (SecurityRoleRefSetCtrl)controllerFactory.get(portletSecurityRoleRefs);

                Iterator p = portletSecurityRoleRefs.iterator();

                while (p.hasNext()) {
                    SecurityRoleRef portletSecurityRoleRef = (SecurityRoleRef)p.next();

                    if (portletSecurityRoleRef.getRoleLink() == null && webAppSecurityRoles.get(portletSecurityRoleRef.getRoleName()) == null) {
View Full Code Here

        assertNotNull("Role users.admin undefined", role);
    }

    private void checkPortletSecurityRoleRefs( PortletDefinition portlet )
    {
        SecurityRoleRefSet roleRefs = portlet.getInitSecurityRoleRefSet();
        assertEquals("Invalid number of security role references found", 2, roleRefs.size());
        SecurityRoleRef roleRef = roleRefs.get("admin");
        assertNotNull("Security Role Ref admin undefined", roleRef);
        assertEquals("security Role link expected", "users.admin", roleRef.getRoleLink());
        roleRef = roleRefs.get("users.manager");
        assertNotNull("Security Role Ref users.manager undefined", roleRef);
        assertNull("Undefined security Role link for users.managers expected", roleRef.getRoleLink());
    }
View Full Code Here

                    servletMapping.setUrlPattern(
                        "/" + portlet.getName().replace(' ', '_') + "/*");
                    servletMappings.add(servletMapping);
                }

                SecurityRoleRefSet servletSecurityRoleRefs =
                    ((ServletDefinitionImpl)servlet).getInitSecurityRoleRefSet();

                SecurityRoleRefSetCtrl servletSecurityRoleRefSetCtrl =
                    (SecurityRoleRefSetCtrl) controllerFactory.get(
                        servletSecurityRoleRefs);

                SecurityRoleSet webAppSecurityRoles = webApp.getSecurityRoles();
                   
                SecurityRoleRefSet portletSecurityRoleRefs =
                    portlet.getInitSecurityRoleRefSet();

                // TODO - Do we need this call? The variable is never read
                SecurityRoleRefSetCtrl portletSecurityRoleRefSetCtrl =
                    (SecurityRoleRefSetCtrl) controllerFactory.get(
                        portletSecurityRoleRefs);

                Iterator p = portletSecurityRoleRefs.iterator();

                while (p.hasNext()) {
                    SecurityRoleRef portletSecurityRoleRef =
                        (SecurityRoleRef) p.next();
                   
View Full Code Here

     */
    public boolean isUserInRole(String roleName)
    {
        PortletEntity entity = portletWindow.getPortletEntity();
        PortletDefinition def = entity.getPortletDefinition();
        SecurityRoleRefSet set = def.getInitSecurityRoleRefSet();
        SecurityRoleRef ref = set.get(roleName);

        String link = null;
        if ( ref != null && ref.getRoleLink()!=null) {
            link = ref.getRoleLink();
        }
View Full Code Here

        Iterator portletIterator = portlets.iterator();
        while (portletIterator.hasNext())
        {
            PortletDefinition portlet = (PortletDefinition) portletIterator
                    .next();
            SecurityRoleRefSet securityRoleRefs = portlet
                    .getInitSecurityRoleRefSet();
            Iterator roleRefsIterator = securityRoleRefs.iterator();
            while (roleRefsIterator.hasNext())
            {
                SecurityRoleRef roleRef = (SecurityRoleRef) roleRefsIterator
                        .next();
                String roleName = roleRef.getRoleLink();
View Full Code Here

        Collection portlets = portletApp.getPortletDefinitions();
        Iterator portletIterator = portlets.iterator();
        while (portletIterator.hasNext())
        {
            PortletDefinition portlet = (PortletDefinition) portletIterator.next();
            SecurityRoleRefSet securityRoleRefs = portlet.getInitSecurityRoleRefSet();
            Iterator roleRefsIterator = securityRoleRefs.iterator();
            while (roleRefsIterator.hasNext())
            {
                SecurityRoleRef roleRef = (SecurityRoleRef) roleRefsIterator.next();
                String roleName = roleRef.getRoleLink();
                if (roleName == null || roleName.length() == 0)
View Full Code Here

        assertNotNull("Role users.admin undefined", role);
    }

    private void checkPortletSecurityRoleRefs( PortletDefinition portlet )
    {
        SecurityRoleRefSet roleRefs = portlet.getInitSecurityRoleRefSet();
        assertEquals("Invalid number of security role references found", 2, roleRefs.size());
        SecurityRoleRef roleRef = roleRefs.get("admin");
        assertNotNull("Security Role Ref admin undefined", roleRef);
        assertEquals("security Role link expected", "users.admin", roleRef.getRoleLink());
        roleRef = roleRefs.get("users.manager");
        assertNotNull("Security Role Ref users.manager undefined", roleRef);
        assertNull("Undefined security Role link for users.managers expected", roleRef.getRoleLink());
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.common.SecurityRoleRefSet

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.