You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Nick Lothian (JIRA)" <pl...@jakarta.apache.org> on 2004/12/10 04:39:22 UTC

[jira] Updated: (PLUTO-46) PortletRequestImpl: isUserInRole(role) must use aliased role-name in portlet.xml

     [ http://nagoya.apache.org/jira/browse/PLUTO-46?page=history ]

Nick Lothian updated PLUTO-46:
------------------------------

    Fix Version: 1.0.1-rc2
                     (was: Current CVS)

> PortletRequestImpl: isUserInRole(role)  must use aliased role-name in portlet.xml
> ---------------------------------------------------------------------------------
>
>          Key: PLUTO-46
>          URL: http://nagoya.apache.org/jira/browse/PLUTO-46
>      Project: Pluto
>         Type: Bug
>   Components: portlet container
>     Versions: Current CVS
>  Environment: Operating System: Other
> Platform: Other
>     Reporter: Frédéric Arnoud
>      Fix For: 1.0.1-rc2

>
> Method isUserInRole(String) of class 
> org.apache.pluto.core.impl.PortletRequestImpl must use the security role
> reference mapping defined in portlet.xml (spec. jsr168 PLT.20.3).
> I propose this new method for the implementation:
> BEGIN ====================================================== 
>     public boolean isUserInRole(String roleName)
>     {
>     	boolean userInRole = false; 
> 		SecurityRoleRef securityRoleRef = portletWindow.getPortletEntity
> ().getPortletDefinition().getInitSecurityRoleRefSet().get(roleName);
> 		/*
> 		 * PLT.20.3: 
> 		 *   "... A security-role-ref element MUST be declared by the 
> portlet
> 		 *    in deployment descriptor with a role-name sub-element 
> containing 
> 		 *    the role-name to be passed to the method." 
> 		 */
> 		if ( securityRoleRef != null )
> 		{
>     		String roleLink = securityRoleRef.getRoleLink();
> 	    	if (roleLink == null)
> 	    	{
> 	    		/*  "If the security-role-ref element does not define a 
> role-link element,
> 	    		 *   the container must default to checking the role-
> name element argument
> 	    		 *   against the list of security-role elements defined 
> in the web.xml 
> 	    		 *   deployment descriptor of the portlet application."
> 	    		 */
> 	    		roleLink = roleName;
> 	    	} 
> 			userInRole = this._getHttpServletRequest().isUserInRole
> (roleLink);
> 		}
> 		return userInRole;
>     }
> END ====================================================== 
> Regards, 
> Fred. Arnoud

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira