Examples of SecurityRoleSet


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

                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();
                   
                    if portletSecurityRoleRef.getRoleLink()== null
                        &&   
                            webAppSecurityRoles.get(portletSecurityRoleRef.getRoleName())==null
                    ){
                        System.out.println(
                            "Note: The web application has no security role defined which matches the role name \""
                                + portletSecurityRoleRef.getRoleName()
                                + "\" of the security-role-ref element defined for the wrapper-servlet with the name '"
View Full Code Here

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

        {
            throw new IllegalStateException(
                    "createWebApp() and createPortletApp() must be called before invoking validate()");
        }

        SecurityRoleSet roles = webApp.getSecurityRoles();
        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)
                {
                    roleName = roleRef.getRoleName();
                }
                if (roles.get(roleName) == null)
                {
                    String errorMsg = "Undefined security role " + roleName + " referenced from portlet "
                            + portlet.getName();
                    throw new PortletApplicationException(errorMsg);
                }
View Full Code Here

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

   
    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()))
            {
                String roleLinkName = roleRef.getRoleLink();
                if (roleLinkName == null || roleLinkName.length() == 0)
                {
                    roleLinkName = roleName;
                }
                Iterator roleIter = roleSet.iterator();
                while (roleIter.hasNext())
                {
                    SecurityRole role = (SecurityRole) roleIter.next();
                    if (roleLinkName.equals(role.getRoleName()))
                        return role.getRoleName();
View Full Code Here

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

            }
            webAppE.appendChild(loginConfigE);
        }
       
        // <security-role>
        SecurityRoleSet securityRoles = webAppImpl.getSecurityRoles();
        if (securityRoles != null) {
            for (Iterator iter = securityRoles.iterator(); iter.hasNext();) {
                SecurityRole securityRole = (SecurityRole)iter.next();
                Element securityRoleE = doc.createElement("security-role");
                addTextElement(securityRoleE, "description", securityRole.getDescription());
                addTextElement(securityRoleE, "role-name", securityRole.getRoleName());
                webAppE.appendChild(securityRoleE);
View Full Code Here

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

                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) {
                        System.out.println(
                            "Note: The web application has no security role defined which matches the role name \""
                                + portletSecurityRoleRef.getRoleName()
                                + "\" of the security-role-ref element defined for the wrapper-servlet with the name '"
                                + portlet.getName()
View Full Code Here

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

    }

    private void checkWebSecurityRoles( MutableWebApplication webApp )
    {
        SecurityRoleSet roles = webApp.getSecurityRoles();
        assertEquals("Invalid number of security role definitions found", 1, roles.size());
        SecurityRole role = roles.get("users.admin");
        assertNotNull("Role users.admin undefined", role);
    }
View Full Code Here

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

                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();
                   
                    if portletSecurityRoleRef.getRoleLink()== null
                        &&   
                            webAppSecurityRoles.get(portletSecurityRoleRef.getRoleName())==null
                    ){
                        System.out.println(
                            "Note: The web application has no security role defined which matches the role name \""
                                + portletSecurityRoleRef.getRoleName()
                                + "\" of the security-role-ref element defined for the wrapper-servlet with the name '"
View Full Code Here

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

     * @throws PortletApplicationException
     */
    public void validate(MutablePortletApplication app)
            throws PortletApplicationException
    {
        SecurityRoleSet roles = app.getWebApplicationDefinition()
                .getSecurityRoles();
        Collection portlets = app.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)
                {
                    roleName = roleRef.getRoleName();
                }
                if (roles.get(roleName) == null)
                {
                    String errorMsg = "Undefined security role " + roleName
                            + " referenced from portlet " + portlet.getName();
                    log.error(errorMsg);
                    throw new PortletApplicationException(errorMsg);
View Full Code Here

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

        {
            throw new IllegalStateException(
                    "createWebApp() and createPortletApp() must be called before invoking validate()");
        }

        SecurityRoleSet roles = webApp.getSecurityRoles();
        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)
                {
                    roleName = roleRef.getRoleName();
                }
                if (roles.get(roleName) == null)
                {
                    String errorMsg = "Undefined security role " + roleName + " referenced from portlet "
                            + portlet.getName();
                    throw new PortletApplicationException(errorMsg);
                }
View Full Code Here

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

    }

    private void checkWebSecurityRoles( MutableWebApplication webApp )
    {
        SecurityRoleSet roles = webApp.getSecurityRoles();
        assertEquals("Invalid number of security role definitions found", 1, roles.size());
        SecurityRole role = roles.get("users.admin");
        assertNotNull("Role users.admin undefined", role);
    }
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.