REST or CSOM with JavaScript to find if user is in particular SharePoint group

Initially I used REST call to find out whether the user is in a particular SharePoint group in SharePoint 2013. Though it works fine when the logged in user is an administrator or part of the queried group, the rest call to
/_api/web/sitegroups/getbyid(xx)/users keeps prompting for user name and password for non-administrator users throwing access denied exception at the end.

After a while investigating, I could not find anything to resolve the rest call issue and I decided to find to alternatives way to find out if the user is in a particular group. I came across the example using CSOM and it works without prompting for user name and password.

Using CSOM to check whether user is in group
http://sharepoint.stackexchange.com/questions/86912/check-if-user-is-in-a-specified-group

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s