cancel
Showing results for 
Search instead for 
Did you mean: 

Acess to system group of a user

sue
Champ in-the-making
Champ in-the-making
Hello,

My objectif is find out if a user is a MANAGER in any site.

So it got to me that I can access it by system groups, because for every site there is 4 groups:

site_[site_name]_SiteCollaborator
site_[site_name]_SiteConsumer
site_[site_name]_SiteContributor
site_[site_name]_SiteManager

I want to know if the user is in any SiteManager group, something like:

if(user.properties["alfUserGroups"].indexOf("SITE_MANAGERS") != -1))

but this one works with normal groups

Can anyone help me out please?

It's urgent >_<
1 REPLY 1

niketapatel
Star Contributor
Star Contributor
user.properties["alfUserGroups"] This wont give you system group. I dont think js API is available which gives system group as well. You can do with your custom java based script.

OR as alternative use below OOB script to get all sites of user which also returns siteManager of that site. From there you can find if user is manager or not.
http://localhost:8080/alfresco/service/api/people/userName/sites

OR if you have list of sites then get user membership/role using below one.

http://localhost:8080/alfresco/service/api/sites/iq/memberships/userName