cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the container group for current user

kayan
Champ in-the-making
Champ in-the-making
Hi,

I am trying to find out the container group name for the logged in user.  I have used the authority service to find out the information but I got the following error

String groupName=serviceRegistry.getAuthorityService().getAuthoritiesForUser(userName)

org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied.  You do not have the appropriate permissions to perform this operation.

Is there any way i can get the containter group for logged in user?


Thanks
Kayan
4 REPLIES 4

flash31186
Champ in-the-making
Champ in-the-making
Hi !
I have the same problem with my development … Have you got a solution for this error ?

Thanks in advance

Michaël

mrogers
Star Contributor
Star Contributor
I'm not in front of Alfresco code at the moment but I think there is a method to get the authorities for the current user.   The method above is to get the authorities for any user and needs admin authority.

cryptomatt
Champ in-the-making
Champ in-the-making
Am running into this problem of the current user not able to figure out what his group memberships are. Is there any simple way to find this in the Foundation API. There is a authorityService.getAuthoritiesForUser but that can only be used by administrator.

mrogers
Star Contributor
Star Contributor
The method you want is  public Set<String> getAuthorities().