cancel
Showing results for 
Search instead for 
Did you mean: 

Site JS API / setMembership() for a group

slibert
Confirmed Champ
Confirmed Champ
Hello all,

I'm customizing some sites using javascript api. Currently I figured out how to add members :

site.setMembership(userName, siteRole);

But I would like to add groups instead of huge number of users.
Does anybody knows how to do that ? Is there some other function I did not see, or can I use site.setMembership but with some tweak to tell it's a group ?


Regards
Sebastien
1 REPLY 1

slibert
Confirmed Champ
Confirmed Champ
Ok, auto-reply. Was too simple and I didn't get enough coffee this morning 😉

setMembership also work for a group. Just need to prefix groupName with "GROUP_".