Introduction
I was using SharePoint rest api in order to read the users from a SharePoint group.
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getbyname('" + groupName + "')/users";
We can use the Add-in web url since the groups are inherited from the parent site (Host web) to the add-in web.
Problem
When a user (other than the site collection administrator) try to access the above rest url, it throws access denied exception.
Solution
Step 1
Go to “People and groups” under Site Setting.
Step 2
Select the group and then go to “Group Setting” under Setting.
Step 3
Then select “Everyone” radio button for the "Who can view the membership of the group?" option.
Step 4
Click OK
Conclusion
Now other users also will have the permission to read the users in the group.
No comments:
Post a Comment