Enabling Quick Launch in batch with setting chrome options causes Access is denied#1789
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1789 +/- ##
==========================================
- Coverage 82.42% 81.22% -1.21%
==========================================
Files 416 637 +221
Lines 28590 45416 +16826
Branches 0 4781 +4781
==========================================
+ Hits 23565 36887 +13322
- Misses 5025 7118 +2093
- Partials 0 1411 +1411 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adam-it
left a comment
There was a problem hiding this comment.
@patrikhellgren Awesome work, and thank you for contributing this fix.
I myself bumped into this issue when testing some provisioning PRs from PnP Framework repo, and was going to fix it when I noticed that you had already done so. Community Rocks 🤩
✅ Checked locally
🔧Cosmetic fixup needed - will do myself
| if (chromeOptions.Navigation != null) | ||
| { | ||
| // Update the navigation visibility | ||
| await (context.Web as Web).RawRequestBatchAsync(batch, BuildQuickLaunchEnabledApiCall(chromeOptions), new HttpMethod("PATCH"), "Update").ConfigureAwait(false); | ||
|
|
||
| // Update the footer displayName | ||
| if (chromeOptions.Footer != null) | ||
| { | ||
| await BuildAndAddSaveMenuStateRequestAsync(chromeOptions.Footer as FooterOptions, null, batch).ConfigureAwait(false); | ||
| } | ||
| } |
There was a problem hiding this comment.
I only have a minor comment that we may combine those two if the conditions how to a single one
#1791 (#1789) It appears that Microsoft has changed the API behavior related to Chrome options and Quick Launch configuration. We recently started experiencing an Access Denied error when applying a site template with Invoke-PnPSiteTemplate. The issue was traced to the header provisioning step: ``` xml <pnp:Header Layout="Standard" /> ``` Further debugging showed that the error originates from the SetChromeOptionsAsync implementation, where SetChromeOptions, SaveMenuState and QuickLaunchEnabled are executed within the same batch request. As a workaround, separating the QuickLaunchEnabled call from the batch and executing it afterward resolves the issue. This suggests there may have been a change in the API's handling of batched requests involving Quick Launch settings.
It appears that Microsoft has changed the API behavior related to Chrome options and Quick Launch configuration. We recently started experiencing an Access Denied error when applying a site template with Invoke-PnPSiteTemplate.
The issue was traced to the header provisioning step:
Further debugging showed that the error originates from the SetChromeOptionsAsync implementation, where SetChromeOptions, SaveMenuState and QuickLaunchEnabled are executed within the same batch request.
As a workaround, separating the QuickLaunchEnabled call from the batch and executing it afterward resolves the issue. This suggests there may have been a change in the API's handling of batched requests involving Quick Launch settings.