JETPACK-1446: Fix issue in newsletter email sent status endpoint#47778
JETPACK-1446: Fix issue in newsletter email sent status endpoint#47778
Conversation
…post access control Co-authored-by: kraftbj <88897+kraftbj@users.noreply.github.com> Agent-Logs-Url: https://github.com/Automattic/jetpack/sessions/b7739a75-869f-4352-9818-0bcab253ce19
Co-authored-by: kraftbj <88897+kraftbj@users.noreply.github.com> Agent-Logs-Url: https://github.com/Automattic/jetpack/sessions/b7739a75-869f-4352-9818-0bcab253ce19
Add tests verifying editors cannot access other authors' posts, admins can access any post, and post authors can access their own. Add defensive comment on the post_id > 0 guard.
…hub.com:Automattic/jetpack into copilot/find-07-fix-email-status-access-control
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
Authors lack edit_others_posts (unlike editors), making them the correct role for testing per-post access denial. Non-existent posts now return 403 for non-admins due to the per-post check, so run the 404 test as admin.
Fixes JETPACK-1446
Proposed changes
Other information
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
GET /wpcom/v2/newsletter-email-sent-status?post_id=<post_id>. Verify a 403 response.