sp-dev-docs
sp-dev-docs copied to clipboard
Graph pages API: Getting access denied getting a page
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [X] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
No response
Describe the bug / error
We are getting Access Denied using Graph API for SharePoint pages in order to get a custom SharePoint page template.
Steps to reproduce
- Permissions configured just with Sites.Read.All as delegated
- Getting a page template from SharePoint with endpoint GET /sites/{site-id}/pages/{page-id}
- Getting Access Denied when the page template is not checked out
- If the page is checked out, it works
- Adding Sites.ReadWrite.All it is working as well
Expected behavior
In order to get a page which is the lowest action it must be allowed just with Sites.Read.All, it doesn't matter if it's checkout or not.