Using SP 2010;
Just for your reference, the following code is to get all the groups that are added at Web/subsite level using SOM
using (SPSite site = new SPSite("http://server/sites/sitecollection/"))
{
using (SPWeb web = site.OpenWeb("test"))
{
foreach (SPRoleAssignment roleAssignment in web.RoleAssignments)
{
if (roleAssignment.Member is SPGroup)
{
Console.WriteLine("Group: " + roleAssignment.Member.Name);
}
}
}
}How to get the same using JavaScript API (SP.js)? Following line of code works, but only in SP 2013.
clientContext.get_web().get_roleAssignments().get_groups();Following line of code is getting the groups from root level site as well. The subsites has got unique permission and does not inherit permission.
clientContext.get_web().get_siteGroups();Any help greatly appreciated.
