sp-dev-docs
sp-dev-docs copied to clipboard
Sites.Selected delegated permission not working with SPFx web part
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
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- SPFx v1.18.2
- Node.js v18.18.0
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
- Build a SPFx web part to get a specific SharePoint site using the Microsoft Graph API (MSGraphClientV3)
- Deploy the web part requiring Sites.Selected permission:
"webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Sites.Selected" } ]
- 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.