SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.23k stars 992 forks source link

Sites.Selected delegated permission not working with SPFx web part #9561

Open a1mery opened 4 months ago

a1mery commented 4 months ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

πŸ’₯ SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

Additional environment details

Describe the bug / error

Sites.Selected delegated permission does not work as expected with SPFx web part using Microsoft Graph API to get a SharePoint site.

Steps to reproduce

  1. Build a SPFx web part to get a specific SharePoint site using the Microsoft Graph API (MSGraphClientV3)
  2. Deploy the web part requiring Sites.Selected permission: "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Sites.Selected" } ]
  3. The site can be retrieved even if no specific permission is granted for the site. All SharePoint sites the user can access can be retrieved from the web part.

Expected behavior

Only sites with specific permission/role can be retrieved from the SPFx web part.

ghost commented 4 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.