Closed ammist closed 6 years ago
Here's a screenshare of the behavior, showing that we can't add or remove tags using the Gutenerg editor.
This is an interesting one, since the current editor doesn't seem to really respect the capabilities for adding terms. For example, as a contributor, I can add a new tag for a post in the current editor, despite the fact that contributors should not have this right:
post_tag
taxonomy requires edit_post_tags
to edit termsedit_post_tags
capability defaults to the value of manage_categories
manage_categories
capability is only afforded to administrators and editorsI believe the issue can be tracked back to this logic, which checks the assign_terms
capability instead (more permissive, as edit_posts
):
Which appears to be tied into this Trac issue:
Because Gutenberg tries to create these terms using the REST API endpoint, and the endpoint checks the edit_terms
capability, the request will fail.
Given the above Trac issue, it's unclear whether moving forward we should want to respect the capability for managing terms before giving the user the option to create a new tag, since there is some conflicting feedback on whether this is intentional.
WP_REST_Terms_Controller
to check the assign_terms
capability of non-hierarchical taxonomies
assign_terms
capabilityClosing in favor of https://github.com/WordPress/gutenberg/issues/5879#issuecomment-380990325
Issue Overview
Logged in as a user with "author" permissions. Created a new post with Gutenberg. Tried to add new tag (one that is new for the blog) in Gutenberg. The new tag briefly flashes, and disappears. It is not saved after clicking update.
Went to the list of posts. Did "Quick Edit". Added a new tag, which was saved. When I went into Guternberg, I was able to see the tag. I can even "delete" it, but, when I update the post, the old tag remains on the post.
We tried this in Firefox, Safari, and Chrome - the same behavior persisted.
Steps to Reproduce (for bugs)
Expected Behavior
When an author creates a new tag using Gutenberg, that tag should be saved with their post. When an author removes a tag using Gutenberg, that tag should be removed from the post.
Current Behavior
Possible Solution
Related Issues and/or PRs
Maybe related: https://github.com/WordPress/gutenberg/issues/1304
Todos