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:
<[EMAIL PROTECTED] contentType="text/html"%> <[EMAIL PROTECTED] 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
