I want to copy a SharePoint Permissions Groups to subsites that does not have that group already. The permissions inheritance is broken.
Lets say we have the following site structure:
https://x.sharepoint.com/SubsiteLevel1/
https://x.sharepoint.com/SubsiteLevel1/SubsiteLevel2/
How would I go about getting the site specific Groups that are used on SubsiteLevel2 (or any site). The problem I am facing is that when I get the Groups from a site I can only get the SiteGroups. So all groups on the Site Collection.
GroupCollection groupCollection = web.SiteGroups;
How can I get the specific groups that are used on a sub site?