Hi Sue,It's easy to get a list of users belonging to a group but not as straightforward to get groups a user belongs to, as I think we have to start with each group we're interested in and check if the user is a memner. Codewise, it can be quite concise though
var user = groups.getUser(person.properties["cm:userName"]);
var grps = groups.getGroups("site_*_Site*", utils.createPaging(-1, 0));
var userRoles = grps.filter(function(grp)
{
return (grp.getAllUsers().filter(function(usr)
{
return usr.userName == user.userName;
}).length > 0)
})
With this code, the userRoles variable will be an array filled with the ScriptGroup objects representing the Share groups that the currently logged in user is part of, e.g. site_xxxx_SiteManager, site_yyyy_SiteConsumer. Not terribly efficient but will do the job - we're just finding a list of groups that match the pattern site_XXXX_SiteYYYY and checking if our user is part of eachI'm sure there are probably other ways of doing it as wellRegardsSteven