sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Graph pages API: Getting access denied getting a page

Open roberAlb opened this issue 1 year ago • 0 comments

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

  1. Permissions configured just with Sites.Read.All as delegated
  2. Getting a page template from SharePoint with endpoint GET /sites/{site-id}/pages/{page-id}
  3. Getting Access Denied when the page template is not checked out
  4. If the page is checked out, it works
  5. 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.

roberAlb avatar Apr 24 '24 11:04 roberAlb