Repository navigation
feat(cli): the api group checks a key by a field's value, as WordPress publishes by status - #3113
Merged
Merged
Conversation
…s publishes by status A manifest permission with values (cli-base's permissions.valueKeys) applies when the JSON body or the query holds one of them: posts.publish before a post whose status is publish or future, and none for a draft. Both places count, as WordPress reads a parameter from either; an HTTP call takes no body field as a flag, so these two are every way to send it. --dry-run and discovery show the key "with status publish or future". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
C3 of the content category, cli-core half: the raw
apigroup checks a permission key by a field's value, so a WordPress CLI cannot publish past a profile that deniesposts.publish.Why
Until now a manifest key applied always, or when a flag was true. A WordPress post is published by
status: "publish", which no flag expresses. cli-base 0.118.0 (#647) writes such keys asvalues. This makes theapigroup honour them. An older cli-core would ask for the key on every call, drafts included.What
appliesinsrc/cli/service-api.tsalso matches when the JSON body or the query holds one of a key'svalues. Both count, because WordPress reads a parameter from either.api-http.ts:84). GraphQL flags are merged into the body before the check. So the body and the query are every way anapicall carries the field._methodoverride can't be sent.--dry-runand discovery show the keywith status publish or future.Testing
statuspublish and future in the body, and for publish in the query. A draft is sent unchanged.alsoChecksshows the condition.applies, which asked for the key on the draft too.src/cli(2,789 tests) passed on a packed build of this cli-base.service-api,profile-site,manifestandcrm/manifestpassed again on 0.118.0 from npm. Typecheck, lint and docs check pass./batch/v1nests calls that this top-level check doesn't see. Both are noted in the plan's journal.🤖 Generated with Claude Code