Add API that checks if user is in group
Right now there is no API to check that. If you add a security group into a SharePoint group, there is no way to check if the current user is a part of the SharePoint group: The user is not listed in the group.Users and the SharePoint group is not listed in the user.Groups. The 3 APIs that allowed to do this in full trust code are missing from CSOM so we need an alternative.
Thanks for your feedback! We’re reviewing your suggestion.
Toby Lawler commented
Doesn't look like there is going to be any movement on this one. There is a workaround for REST where you can use the SiteGroups endpoint and the CanCurrentUser[Edit|View]Membership method. This does work for groups within groups when the Group settings for View or Edit Membership are set properly. Returns a boolean. I'm not sure if there's an equivalent in CSOM but the REST call could be made from CSOM.
Garry Trinder commented
Great idea. We are seeing some real pain points around the management of users and groups in CSOM, this is one of them.
David Sass commented
Excellent idea, this feature would be awesome!