#38958 closed defect (bug) (fixed)
REST API: Capability check for creating terms differs from wp-admin
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.7 | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | Taxonomy | Keywords: | has-patch commit dev-reviewed |
| Focuses: | rest-api | Cc: |
Description
The capability check used in WP_REST_Terms_Controller when attempting to create a new term is manage_terms, but it should be edit_terms.
Refs:
- https://core.trac.wordpress.org/browser/trunk/src/wp-admin/edit-tags.php?rev=39308&marks=74#L70
- https://core.trac.wordpress.org/browser/trunk/src/wp-admin/edit-tags.php?rev=39308&marks=322#L320
In #33975 we'll hopefully change this to create_terms.
Attachments (1)
Change History (15)
#4
@
9 years ago
Approved for commit (Ryan already added the commit keyword). @johnbillion care to +1 and commit?
This ticket was mentioned in Slack in #core by helen. View the logs.
9 years ago
#7
@
9 years ago
- Keywords dev-reviewed removed
- Owner set to jorbin
- Status changed from new to assigned
#9
follow-up:
↓ 13
@
9 years ago
It would be great to document the difference (if there is any) between edit_terms and manage_terms at some point, they appear to be used somewhat interchangeably in core.
I could not find any documentation at the moment (as mentioned in comment:6:ticket:38857).
#13
in reply to:
↑ 9
@
9 years ago
Replying to SergeyBiryukov:
It would be great to document the difference (if there is any) between
edit_termsandmanage_termsat some point, they appear to be used somewhat interchangeably in core.
I could not find any documentation at the moment (as mentioned in comment:6:ticket:38857).
Makes sense, I know I am not 100% clear on the intended difference. I was also not clear on the next action or directed target of your comment (perhaps @johnbillion ?), but I did not interpret it is a blocker for commit. Please let me know if I assumed incorrectly.
It appears the capability is actually both
manage_termsandedit_termsin the admin;edit-tags.phphas an earlier check formanage_terms.XML-RPC was updated in [38698], see also #35614; makes sense to update to match the new caps.
Patch looks good.
WP_REST_Taxonomies_Controllerstill contains 3 instances ofmanage_terms, but seems like those uses haven't changed?