tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject Re: user roles in tiles.
Date Fri, 08 Jun 2007 09:38:59 GMT
2007/6/8, Sivaswamynatha K <k.sivaswamynatha@kavniya.com>:
> I want to use user roles in tiles. How to use the user roles in tiles? I
> add role attribute in my tiles-def.xml for menus. I have separate jsp
> for listing this menu. How can I show and hide menus based on the user
> role? Whether I have to write any code in this jsp also. Please help me.

The roles used in Tiles refer to the possibility to show or not to
show a definition.
(In fact, the same should be available for attributes, but for some
reasons it is not evaluated at all, probably it's a bug, hey thank you
:-) )
The role is the role specified with JAAS. If you want your way of
managing roles, I think that you need to create your specific
implementation of TilesRequestContext (and TilesContextFactory).

For example, if you specify a definition this way:

<definition name="my.definition" role="customer">
<!-- attributes-->
</definition>

If you want more control, you can use the "Request" taglib from
Jakarta Taglibs (though it seems to be deprecated):
http://jakarta.apache.org/taglibs/doc/request-doc/request-1.0/index.html#isUserInRole

You can consider using Dimensions, but you have to wait that a release
for Tiles 2 is created:
http://mutidimensions.sf.net/

HTH a bit
Antonio

Mime
View raw message