AnsweredAssumed Answered

List all site roles of a user

Question asked by joonas on Mar 14, 2016
Latest reply on Mar 16, 2016 by joonas

I'm trying to list all site roles (or preferably site groups) of a user.

I'm familiar with
GET /alfresco/s/api/people/{userName}?groups=true
to get the groups the user is a member of, but it doesn't return site groups such as GROUP_site_{sitename}_SiteContributor. Could I somehow modify this request to also get all site groups of the user?

Other request I have tried to use to solve this is
GET /alfresco/s/api/people/{userid}/sites?size={pagesize?}&pos={position?}&roles={roles?}
which lists sites the user is an explicit member of, but this doesn't return the exact member roles/groups of {userid}. Could I perhaps use the roles-parameter to find this out? I have learned that using roles=user I can get the site roles of the user making the request, but I want to find out the site roles of {userid}. 

I can also get the user's role for a site by using
GET /alfresco/s/api/sites/{shortname}/memberships/{authorityname}
, but using this I would have to loop through all the sites to get the list of all site roles of a user, which doesn't seem a nice solution.

Is there a way to solve this problem?