Skip to content

Add per-post toggle for co-author edit access after publish#19

Merged
dd32 merged 3 commits into
trunkfrom
claude/editor-post-publish-access-lzatC
Apr 28, 2026
Merged

Add per-post toggle for co-author edit access after publish#19
dd32 merged 3 commits into
trunkfrom
claude/editor-post-publish-access-lzatC

Conversation

@dd32
Copy link
Copy Markdown
Owner

@dd32 dd32 commented Apr 28, 2026

Summary

  • Co-authors lose edit_post access by default once a post is published. The post author and site editors/admins keep their access via core WP rules.
  • New per-post boolean meta _map_co_author_post_publish_access (default off). When enabled, co-authors keep edit access after publish.
  • New REST endpoints GET/PUT /multi-author-posts/v1/posts/<id>/settings. The PUT requires the post-type-specific edit_others_posts cap, so co-authors and Author-role post authors cannot toggle it.
  • Sidebar gains an "Allow co-authors to edit after publish" toggle, visible only to users who can change the setting.
  • README updated to document the new behavior.

Test plan

  • JS unit tests (npm run test:unit) — 12/12 pass, including 3 new tests for toggle visibility and PUT persistence.
  • PHP unit tests (CI) — new coverage in Test_Capabilities (publish gate on/off, post author retains access, read still allowed, toggle round-trip), Test_Co_Authors (helpers), and Test_Rest_API (editor allowed, post author 403, co-author 403, default reflects role).
  • Manual: as an Editor, toggle the new control on a draft, publish, and confirm a co-author can still edit. Toggle off and confirm the co-author loses access.
  • Manual: confirm Author-role post authors and co-authors do not see the toggle.

https://claude.ai/code/session_01UCHBMFpZojARMkWfgP7BtH


Generated by Claude Code

claude added 3 commits April 25, 2026 08:58
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.
@dd32 dd32 merged commit 3280fa6 into trunk Apr 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants