Change WordPress user roles and capabilities Forums How to or FAQ Duplicate Post capabilities

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #3803
    edering
    Participant

    Hi. I created a Role called Manager. It does not give access to Pages or Posts, but I want the capability for Duplicate WooCommerce Products for this Role. We use this Plugin which does it for all Pages, and Posts including WooCommerce Products. https://wordpress.org/plugins/duplicate-post/ But I do not see any capability to select for Duplicate (or Copy or Clone). How do I do this?

    #3804
    Vladimir
    Keymaster

    Hi,

    Look for ‘copy_posts’ or ‘copy_products’ capability. If it does not exist yet, add it manually. I answer without testing.

    #3806
    Vladimir
    Keymaster

    As test showed, ‘copy_posts’ capability is enough to product duplication too.

    #3807
    edering
    Participant

    I had that already checked – https://www.screencast.com/t/grRDYmG7PEJl for that role. But when I login as a User for that Role, Clonedoes not appear for Products (it does as an Admin). See this which shows me hovering over a WooCommerce Product and not seeing Clone – https://www.screencast.com/t/SkmYZ484ME

    but when I do it for a Page, Clone is there. https://www.screencast.com/t/ygUcBgCZjk

    #3808
    Vladimir
    Keymaster

    It’s strange, that I have another result.

    Compare my test role with yours.

    #3809
    edering
    Participant

    I checked and all capabilities you have, I have (plus more). https://www.screencast.com/t/2JQdUl0R Any other ideas?

    #3811
    Vladimir
    Keymaster

    It seems a problem is not related to the capabilities granted to a user.

    1) Try to switch temporally to the default 2017 theme;
    2) Try to deactivate all plugins except WooCommerce and Duplicate Posts;
    3) If 2 items above will not show a source of a problem, try to reproduce it on a test data copy or if its not critical, use live data. Provide me a copy of your site files and database. I will install them at my local development environment and find a reason using PHP debug session.

    #3822
    edering
    Participant

    Hi. I figured it out, but don’t have a solution. Duplicate Post has a Permissions area based on Roles – https://www.screencast.com/t/o4JWEBro – but my custom URE Roles are not appearing, so I cannot select it. I sent Duplicate Post a question on how to add Roles to their Permission list, no word yet.

    #3823
    Vladimir
    Keymaster

    “Duplicate Posts” includes roles to the roles list at its “Permissions” page checking this condition:

    
    // role should have at least edit_posts capability
    if ( !$role->has_cap('edit_posts') ) continue;
    

    So if you wish to see your role there, then add ‘edit_posts’ capability to it. When you turn ON checkbox for a role here, “Duplicate Posts” just adds ‘copy_posts’ capability to it. And DP plugin shows checkbox for a role turned ON if that role has ‘copy_posts’ capability already. That’s it.

    With my test example, I do not see my custom ‘Vendor’ role at DP permissions page roles list, but I have access to the duplicate post actions…

    I suppose that you have some other condition, which prevents to use DP plugin for your custom role.

    #3824
    edering
    Participant

    Ah, thanks. I was trying to keep that off so the client would not have access to some Custom Post Types, but this is fine.

    #8869
    edering
    Participant

    Hi Vladimir. I am having the above issue (similar) again on a new site. A new Role has all capabilities for Posts and Products (like copy_) set. And in Duplicate Post, the Permissions tab shows my new Role (Drucker Admin) selected. Products are not showing the Clone/Duplicate link on the main Products page, and the “Copy to new draft” link on the individual products is not showing. But all custom post types do have it. On the Permissions tab for Duplicate Posts, the section called “Enable for these post types” does not show Products or Woocommerce. I did set Product Variations, but that did not help. https://app.screencast.com/GFVGrY4NTnPUB Any idea how to fix this?

    #8870
    edering
    Participant

    I solved it, sort of. I turned on all remaining Woocommerce capabilities and now cloning works. I’m not sure what capabilities mattered that Products were not covered, but it worked.

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