cancel
Showing results for 
Search instead for 
Did you mean: 

Returning all 'System' groups for a user

paulf
Champ in-the-making
Champ in-the-making
Hi everyone,

Firstly, please accept my apologies as I seem to only be posting questions to this forum as opposed to helping others. I'm still new to Alfresco unfortunately.

I wanted to ask if there is a way to query (either via webscript or Java API) for ALL groups (including system groups) that a user is a member of?

The key to this is that I need all of the system groups. By using getContainerGroups() I can get the user-defined groups that a user is a member of. The trouble is, I need the system groups too.

E.G.
I have a site named "Site1". This site is created with system groups : GROUP_site_site1_SiteCollaborator, GROUP_site_site1_SiteConsumer and so on.
I have added user 'jsmith' to the site1_SiteConsumer system group.

Given this user's name I need to be able to find out that 'jsmith' is a member of the "GROUP_site_site1_SiteConsumer" group.


——

NOTE: I noticed in another thread that someone asked how they can identify if the user in question is in a system group FOR ONE SITE ONLY. I cannot use this. I need to know what system groups a user is in across many different sites.


I really hope someone can help.

Many thanks
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Your requirement may be surprisingly tricky.  Since groups can contain other groups.

But if you are looking for a java API the first port of call is the AuthorityService in particular methods like AuthorityService.getContainingAuthorities();

paulf
Champ in-the-making
Champ in-the-making
Many thanks for your response. It is very much appreciated. I will have a look into the AuthorityService class and see what I can find.

paulf
Champ in-the-making
Champ in-the-making
Hi all,
Following on from my original post above, I wondered if anyone knows how to go about using the getReaders() method mentioned on the following page:

http://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/security/PermissionService.html

In my current solution I am using a combination of CMIS, Alfresco API and web scripts to do what I need - however, I am interested in this method.

I guess my question is, how do I get the ACL ID that I can use as a parameter with this getReaders() method?  Is this something I need to do in Java or is it something to implement in a web script?

Are there any examples of this method in action? I can't seem to find any.

Thanks for your time