myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Łukasz Budnik" <lukasz.bud...@gmail.com>
Subject visibleOnUserRole error
Date Mon, 10 Mar 2008 19:39:54 GMT
Hi All!

I have a problem using Tomahawk visibleOnUserRole attribute.
It seems it does not work at all.

Given simple code:

before
<t:div visibleOnUserRole="viewer">I'm a viewer!!</t:div>
<t:div visibleOnUserRole="executor">I'm an executor!!</t:div>
<t:div visibleOnUserRole="admin">I'm an admin!!</t:div>
<t:div>works</t:div>
after

When I sign in as a user 'xh' that has 'viewer' and 'executor' roles,
the result is:

before
works
after

expected:

after
I'm a viewer!!
I'm an executor!!
works
before

The JAAS works for sure I wrote a simple TestFilter and overrode the
doFilter method, I have:

String[] roles = new String[] { "viewer", "executor", "admin" };

for (String role : roles) {
	logger.debug("Is user in '" + role + "' role? ==> "
	+ ((HttpServletRequest) request).isUserInRole(role));
}

logger.debug(((HttpServletRequest) request).getUserPrincipal().getName());

and the result is:

19:50:46,109 DEBUG [TestFilter] Is user in 'viewer' role? ==> true
19:50:46,109 DEBUG [TestFilter] Is user in 'executor' role? ==> true
19:50:46,109 DEBUG [TestFilter] Is user in 'admin' role? ==> false
19:50:46,109 DEBUG [TestFilter] xh

so, clearly there is some kind of error in Tomahawk.

I'm using MyFaces 1.2 and Tomahawk 1.1.7-SNAPSHOT. My app is deployed on
Apache Geronimo application server.

any ideas?

best regards
Łukasz
Mime
View raw message