#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
@
8 years ago
38958.diff Approved for commit (Ryan already added the commit
keyword).
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#7
@
8 years ago
- Keywords dev-reviewed removed
- Owner set to jorbin
- Status changed from new to assigned
#9
follow-up:
↓ 13
@
8 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
@
8 years ago
Replying to SergeyBiryukov:
It would be great to document the difference (if there is any) between
edit_terms
andmanage_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).
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_terms
andedit_terms
in the admin;edit-tags.php
has 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_Controller
still contains 3 instances ofmanage_terms
, but seems like those uses haven't changed?