Change WordPress user roles and capabilities Forums How to or FAQ Role can't edit taxonomy on CPT

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5970
    bopdesign
    Participant

    Hi,

    I have a custom post type set up for Open Positions on my client’s site. There’s a taxonomy called Locations for each of my client’s offices. They want to have a user account that only has access to edit the Open Positions CPT, which I was able to set up no problem.

    The issue is the custom role can’t edit the Locations taxonomy. The meta box is visible, but the user can’t make any changes.

    I know I must be missing something, but I have no idea what. Can you please help? Thank you!

    #5971
    Vladimir
    Keymaster

    Hi,

    By default even contributor with just ‘edit_posts’ can turn ON/OFF categories checkboxes. Try to deactivate related plugins just to check if there is some conflict.

    #5972
    bopdesign
    Participant

    Hi Vladimir,

    Thanks for the quick response! Turning on “edit_posts” gave the custom role access to edit the taxonomy. But now it also has access to the other CPTs I have on the site.

    Is it possible to give this role complete control over a single CPT?

    #5973
    Vladimir
    Keymaster

    You have 2 ways to achieve this:
    1) Force all CPT to use own capabilities, like ‘edit_videos’ for ‘Video’ CPT, etc. Use similar checkbox under ‘Edit restrictions’ section at Settings->User Role Editor->Additional modules tab. You may need to go through your roles to check if they do not lose needed access, like Media Library item editing, which will use edit_attachements instead of edit_posts.

    or

    2) User Admin menu blocking add-on to block admin menu items for CPTs unneeded to this role.

    #5978
    bopdesign
    Participant

    I do have the option to force all CPT to use their own capabilities. I have all of the capabilities turned on for this particular CPT, as well. Here are a couple of screenshots:
    https://www.dropbox.com/s/hmw8cr074d4crn5/Screen%20Shot%202019-10-07%20at%209.06.06%20AM.png?dl=0
    https://www.dropbox.com/s/cqnh3s4lojvxvp4/Screen%20Shot%202019-10-07%20at%209.06.25%20AM.png?dl=0

    #5979
    Vladimir
    Keymaster

    Having all CPTs using own capabilities, when you add ‘edit_post’, role should get access to CPT, to which you not granted access.
    What’s a problem now?

    #5982
    bopdesign
    Participant

    It’s back to the issue before: the role can now edit the taxonomies, but it also has access to CPTs I don’t want it to access. You said that forcing all CPT to user their own capabilities would fix it, but it doesn’t seem to work.

    Sorry if I’m missing something obvious. I don’t have a ton of experience with this. 🙂

    #5983
    bopdesign
    Participant

    Actually, I think I’m just going to hide those other CPT in the admin menu. That’s the simplest solution at this point and I like simple. 🙂

    Thanks so much for your help!

    #5985
    Vladimir
    Keymaster

    Thanks for letting me know that you found a solution more suitable for your use case.

    Generally, when URE forces CPTs to use own capabilities, it does this for all CPTs with default ‘edit_posts’ capabilities set. So CPT ‘video’ will use ‘edit_videos’ instead of ‘edit_posts’, etc. And if role does not have ‘edit_videos’ capability it does not have access to ‘Videos’ CPT, even if role still has ‘edit_posts’ capability.

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