0

When using _api/web/siteusers? I get a lot of usernames and email adresses.

With XPath I managed to filter them.

Then I realized that there were a huge amount of usernames and email adresses who don't have access to my page.

In SharePoint theREST API /_api/web/siteusers endpoint only provides the list of users has permission on current web.

How can I fetch the users who have the permission to use my Sharepoint page?

2 Answers 2

1

In case of you need to see permissions on the web you can simply

  • Navigate to the web permissions page (http://XXX/_layouts/15/user.aspx)

In case of you need to see permissions to particular site page try the following

  • Open site pages library
  • Select page
  • Click on Shared with - Advanced
2

to get permissions on SharePoint page by SP rest Api You may use the fallowing request:


.../_api/web/GetFileByServerRelativeUrl('[RELATIVE URL OF PAGE]')?$expand=ListItemAllFields/RoleAssignments/Member,ListItemAllFields/RoleAssignments/RoleDefinitionBindings,ListItemAllFields/RoleAssignments/Member/Users

where the relative url of the page would of a page like: https://SomeSharepoint.sharepoint.com/sites/test2/SitePages/test1.aspx will be /sites/test2/SitePages/test1.aspx and the request would look like


https://SomeSharepoint.sharepoint.com/sites/test2/_api/web/GetFileByServerRelativeUrl('/sites/test2/SitePages/test1.aspx')?$expand=ListItemAllFields/RoleAssignments/Member,ListItemAllFields/RoleAssignments/RoleDefinitionBindings,ListItemAllFields/RoleAssignments/Member/Users

Hope it helps

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.