myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manfred Geiler <manol...@apache.org>
Subject Re: visibleOnUserRole not working?
Date Thu, 03 Mar 2005 13:37:08 GMT
Alessandro Polverini schrieb:
> On Wed, 2005-03-02 at 22:39 +0100, Manfred Geiler wrote:
> 
>>Alessandro,
>>The visibleOnUserRole and enabledOnUserRole attributes cause the 
>>according component to be visible/enabled whenever the isUserInRole of 
>>the current HttpServletRequest returns true. Nothing more.
>>So if it does not work, please check the JAAS configuration of your 
>>webcontainer. What is your exact environment? Tomcat?
> 
> 
> Hello Manfred, and thanks for your reply.
> 
> I made what I think could be the smallest test, and that is the source
> of the page:
> 
> <%@page contentType="text/html"%>
> <%@page pageEncoding="UTF-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
> <html><body>
> <f:view>
>     <x:outputText value="MyFaces says current user has role dummy" visibleOnUserRole="dummy"/><BR/>
>     servlet says current user has role dummy: <%= request.isUserInRole("dummy") %><BR/>
> </f:view>
> </body></html>
> 
> And the output is:
> 
> MyFaces says current user has role dummy
> servlet says current user has role dummy: false
> 
> So I think something is wrong in myfaces implementation since
> request.isUserInRole() return false but outputText is showing the text
> anyway.
> I'm using tomcat 5.0.28 with JDBC realm and authentication it's running
> fine for the other aspects.
> 
> Should I open a bug report on Jira?

Yes, please.

Manfred

Mime
View raw message