Change WordPress user roles and capabilities Forums Bug Reports Unable to add/remove tags when editing a post

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7435
    awu
    Participant

    Hello,

    I configured a user who has the Editor role and manage_categories permission enabled. This user is restricted to edit posts for category ID = 3 (following the instructions here: https://www.role-editor.com/allow-user-edit-selected-posts/).

    What to do: “Allow”
    with category/taxonomy ID: 3

    The user is able to see and edit posts that belong to category ID 3. When editing/creating a post, however, they are unable to add or remove tags. The API call to fetch tags returns an empty array:

    /wp-json/wp/v2/tags?per_page=20&orderby=count&order=desc&_fields=id,name&search=test&_locale=user => []

    Removing the value 3 from “with category/taxonomy ID” fixes the tag issue but then the user is able to edit all posts.

    Since this role has the manage_categories permission, the user is able to make edits to tags and categories by visiting:

    Posts -> Tags
    Posts -> Categories

    If the user visits Posts -> All Posts and immediately visits the Tags or Categories dashboard, there will be 0 results. Refreshing the page will show the list of all tags and/or categories.

    WordPress 5.7
    User Role Editor Pro 4.59.2

    #7438
    Vladimir
    Keymaster

    Hi,

    It seems as expected behavior. Restriction by category ID is global for all taxonomies. So when you all to see at backend and edit only posts with category (taxonomy) ID=3, you automatically prohibit editing posts with any other taxonomy ID. Thus use can not add to the post new tags/taxonomies.

    As about 0 items at the tags or categories page, it is a result of URE’s internal caching. But if you limit user to edit post only with the restricted list of existing taxonomies – you should not allow him to edit them. You have to delegate this function to another user according to my logic. So taxonomy editing pages should not be available to a user restricted such way.

    #7440
    awu
    Participant

    Hi Vladimir,

    Thanks for the explanation. Are there any workarounds when using URE that will allow the user to tag and/or categorize the post?

    Ideally:

    User is restricted to create and edit posts that have category ID 3
    User should be able to add/remove tags to these posts

    #7443
    Vladimir
    Keymaster

    Hi,

    Currently there is no such workaround. Restriction is applied to all existing taxonomies at once.
    I will think how to exclude selected taxonomies from the restriction using custom filter and apply this to one of the future versions.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.