portals-jetspeed-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Watler <wat...@wispertel.net>
Subject Re: How to get the user's current role?
Date Fri, 02 Jun 2006 13:51:53 GMT

There is, at least, a J2 specific way: get the Subject for the current
user and iterate over the Subject's principals. You can find plenty of
code examples in the code base that do this. In particular, see the
Profiler component.



On Thu, 2006-06-01 at 19:41 -0700, (Jay) Jun Yan wrote:
> Hi, there,
> In our system, one user can have only one role. We want to show which role
> he has. I know that to use HttpServletRequest.isUserInRole() against each of
> all those roles defined will enable me to find the role the user has. But,
> is there a better way other than to query out all role then go through them
> one by one, something like getRole()?
> Thanks,
> Jay

To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org

View raw message