"dalvarezpy" wrote : My question is now: how do I "use" my security framework 
from within SEAM? I mean, I'd like to customize the views according to the 
roles the user have (e.g. show a given button only to Admins), so I would like 
to know any moment what roles the user have, for example. Is there a way to do 
this?
The approach I use to employ the JAAS model in JSF is to use the Tomahawk 
extensions. Most of their components have a "enabledOnUserRole" and/or 
"visibleOnUserRole" attribute. These roles are JAAS roles.
So you could use something like<t:commandLink 
visibleOnUserRole="Developer,Administrator" value="yehaa" 
action="somethingimportant" />to hide the linke to anybody but users with JAAS 
role Developer or Administrator.
For tags which don't have these attributes you could add a mathod like 
thispublic Map<String, Boolean> getRoleList();to your User object (the Map has 
to be populated somehow with all and the roles the users is assigned to) and 
use the standard JSF tags with their "rendered" attribute like 
this<h:commandLink rendered="#{loggedInUserObject.roleList['Developer'] or 
loggedInUserObject.roleList['Administrator']}" value="yehaa" 
action="somethingimportant" />to achieve very much the same as with the 
Tomahawk extensions.
Or another option would be to just use the Tomahawk "div" component to wrap it 
around tags which do not have role ACL capabilities on their own.

Hope it helps

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3936929#3936929

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3936929


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to