cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the Group of a user

kshirod
Champ in-the-making
Champ in-the-making
I want to know the group of a user. Suppose I logged in as a salesrep, in the LoginBean class I need to get the Group in which salesrep belongs…Is there any api to get that. Plz reply to this.
1 REPLY 1

tfaudot
Champ in-the-making
Champ in-the-making
you can get the authorities(groups) of a user like this:


FacesContext context = FacesContext.getCurrentInstance();
ServiceRegistry serviceRegistry = Repository.getServiceRegistry(context);
AuthorityService as = serviceRegistry.getAuthorityService();
Set<String> auths = as.getAuthorities();