You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "BONAIUTO,JAMES (HP-NewJersey,ex1)" <ja...@hp.com> on 2001/07/13 22:47:47 UTC

Todo List - Enhance Role Checking

Enhance Role Checking. Enhance <logic:present> to accept a comma delimited
list of roles in the role attribute, and process the nested body content if
any of the listed roles where owned by the current user. A corresponding
change to <logic:notPresent> would process the nested body content only if
none of the listed roles were owned by the present user. 

Here is my code for this todo list item:
in PresentTag.java :

else if (role != null) {		
     HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
     StringTokenizer st(role, ",", false);
     while(!present && st.hasMoreTokens()){
		present = request.isUserInRole(st.nextToken());
     }
}