Package org.apache.pluto.om.common

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


    public SecurityRoleRef get(String roleName)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            SecurityRoleRef securityRoleRef = (SecurityRoleRef)iterator.next();
            if (securityRoleRef.getRoleName().equals(roleName)) {
                return securityRoleRef;
            }
        }
        return null;
    }
View Full Code Here


    public SecurityRoleRef remove(String roleName)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            SecurityRoleRef securityRoleRef = (SecurityRoleRef)iterator.next();
            if (securityRoleRef.getRoleName().equals(roleName)) {
                super.remove(securityRoleRef);
                return securityRoleRef;
            }
        }
        return null;
View Full Code Here

                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 '"
                            + portlet.getName()
                            + "'.");
                    break;           
                }
                SecurityRoleRef servletSecurityRoleRef =
                    servletSecurityRoleRefs.get(
                        portletSecurityRoleRef.getRoleName());
                if (null != servletSecurityRoleRef) {
                    System.out.println(
                        "Note: Replaced already existing element of type <security-role-ref> with value \""
View Full Code Here

    // SecurityRoleRefSet implementation.

    public SecurityRoleRef get(String roleName) {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            SecurityRoleRef securityRoleRef = (SecurityRoleRef)iterator.next();
            if (securityRoleRef.getRoleName().equals(roleName)) {
                return securityRoleRef;
            }
        }
        return null;
    }
View Full Code Here

    }

    public SecurityRoleRef remove(String roleName) {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            SecurityRoleRef securityRoleRef = (SecurityRoleRef)iterator.next();
            if (securityRoleRef.getRoleName().equals(roleName)) {
                super.remove(securityRoleRef);
                return securityRoleRef;
            }
        }
        return null;
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();
    } else {
      link = roleName;
    }

    return this._getHttpServletRequest().isUserInRole(link);
View Full Code Here

            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();
View Full Code Here

    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

            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();
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();
    } else {
      link = roleName;
    }

    return this._getHttpServletRequest().isUserInRole(link);
View Full Code Here

TOP

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

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.