Core Data: Fix 'canUser' returning 'undefined' when the allow header is missing#76307
Core Data: Fix 'canUser' returning 'undefined' when the allow header is missing#76307
Conversation
|
Size Change: +3 B (0%) Total Size: 6.89 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in ce8cc60. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22845993662
|
youknowriad
left a comment
There was a problem hiding this comment.
The change makes sense to me. Curious though did you see actual issues as a result of this?
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Nothing that could potentially break things, but here was thinking:
|
What?
Cast permission values to boolean in
getUserPermissionsFromAllowHeadersocanUserreturnsfalseinstead ofundefinedwhen the response has no allow header. e.g., React Native, or more restrictive APIs.Why?
I noticed this while experimenting with the Plugins endpoint and testing with low-cap users.
Testing Instructions
The fix and resolve has good unit test coverage.