-
1. Re: how to access users role list...
gavin.king Jul 5, 2007 3:26 PM (in response to ulath)What do you need it for?
-
2. Re: how to access users role list...
ulath Jul 5, 2007 3:57 PM (in response to ulath)i want to get list and decide something in the java code programatically, of course i can hit the db again to get roles or store roles in a session object but i just want to know is there a way to access using seam security mechanism...
-
3. Re: how to access users role list...
gavin.king Jul 5, 2007 4:14 PM (in response to ulath)Would a boolean hasRole(String) method solve your problem?
-
4. Re: how to access users role list...
gavin.king Jul 5, 2007 4:15 PM (in response to ulath)(This method already exists.)
-
5. Re: how to access users role list...
ulath Jul 5, 2007 4:22 PM (in response to ulath)i know the hasRole method, but i need the role name(s) of user (admin, customer)....
-
6. Re: how to access users role list...
shane.bryzak Jul 5, 2007 9:57 PM (in response to ulath)Identity.getSubject() returns the subject, from which you can iterate through the principals to find the "Roles" group.
-
7. Re: how to access users role list...
bulloncito Jul 6, 2007 6:04 PM (in response to ulath)I have a "Profile" entity, so I do:
employee.getProfile().getPermissions() wich are a bunch of strings, assigned to user at loginTime (#{authenticator.authenticate}) as roles, so xhtml uses #{s:hasRole('role')} and java uses Profile object, hope that helps.