Add per-post toggle for co-author edit access after publish#19
Merged
Conversation
Co-authors lose edit access on publish by default. Editors and admins can opt in per-post via a new sidebar toggle, persisted as post meta and enforced in the capability filter. The REST settings endpoint gates updates on edit_others_posts so co-authors and lone post authors without that cap cannot toggle it.
The post factory defaults to status=publish, which collides with the new co-author edit-on-publish gate. Tests that exercise pre-publish co-author behavior now create draft fixtures explicitly; the publish-gate tests still transition to publish themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
edit_postaccess by default once a post is published. The post author and site editors/admins keep their access via core WP rules._map_co_author_post_publish_access(default off). When enabled, co-authors keep edit access after publish.GET/PUT /multi-author-posts/v1/posts/<id>/settings. ThePUTrequires the post-type-specificedit_others_postscap, so co-authors and Author-role post authors cannot toggle it.Test plan
npm run test:unit) — 12/12 pass, including 3 new tests for toggle visibility and PUT persistence.Test_Capabilities(publish gate on/off, post author retains access, read still allowed, toggle round-trip),Test_Co_Authors(helpers), andTest_Rest_API(editor allowed, post author 403, co-author 403, default reflects role).https://claude.ai/code/session_01UCHBMFpZojARMkWfgP7BtH
Generated by Claude Code