• Resolved maxence1502

    (@maxence1502)


    Hello,

    I am looking to create a role on my site that allows the user to access the wp-admin but can ONLY edit products.
    Which role should I use?
    I have seen that there are plugins to create/modify the permissions of the roles but what permissions should be set?

    Thank you very much

Viewing 6 replies - 1 through 6 (of 6 total)
  • Saif

    (@babylon1999)

    Hello @maxence1502,

    I am looking to create a role on my site that allows the user to access the wp-admin but can ONLY edit products.

    There’s a Shop Manager role that comes natively with WooCommerce. A shop manager will have all the rights a customer has, and are granted the main capabilities to create/edit products and access to WooCommerce reports.

    If you need more options to edit the capabilities, you can check the following plugin: https://woocommerce.com/products/user-roles-editor-for-woocommerce/

    All extensions sold on WooCommerce.com have a 30-day refund policy. If the product doesn’t work the way you need it or you think another product would work better, we are more than happy to provide a full refund.

    Hope this helps!

    Thread Starter maxence1502

    (@maxence1502)

    Thank you for your answer.
    I can’t figure out how to hide the “Orders” tab in wp-admin. Is it possible to do this with custom code otherwise?

    Saif

    (@babylon1999)

    You can try working around the admin_menu hook, but I’m not sure how you can deny access to the order links if they were visited directly from the URL.

    Instead of reinventing the wheel, you can check the plugins below.

    https://www.ads-software.com/plugins/leira-roles/

    https://www.ads-software.com/plugins/advanced-access-manager/

    Let us know if they work!

    Thread Starter maxence1502

    (@maxence1502)

    I’ve seen these plugins, and I’m using one of the same kind (https://www.ads-software.com/plugins/user-role-editor/). I did a var_dump of the role in question which returns these permissions:

    object(WP_Role)#9440 (2) { [“name”]=> string(10) “dc_manager” [“capabilities”]=> array(22) { [“assign_product_terms”]=> bool(true) [“delete_posts”]=> bool(true) [“delete_product”]=> bool(true) [“delete_products”]=> bool(true) [“delete_published_products”]=> bool(true) [“delete_published_shop_coupons”]=> bool(true) [“delete_shop_coupon”]=> bool(true) [“delete_shop_coupons”]=> bool(true) [“edit_posts”]=> bool(true) [“edit_product”]=> bool(true) [“edit_products”]=> bool(true) [“edit_published_products”]=> bool(true) [“edit_published_shop_coupons”]=> bool(true) [“edit_shop_coupon”]=> bool(true) [“edit_shop_coupons”]=> bool(true) [“manage_product”]=> bool(true) [“manage_product_terms”]=> bool(true) [“publish_shop_coupons”]=> bool(true) [“read”]=> bool(true) [“read_product”]=> bool(true) [“read_shop_coupon”]=> bool(true) [“upload_files”]=> bool(true) } }

    There is no permission for the user to see the orders, they can only edit the products normally. But this is not the case, there is the “Orders” tab and the page is accessible. Isn’t there a bug in Woocommerce?

    Howdy @maxence1502

    Feel free to check out:

    • The Admin Menu Editor plugin, for adjusting the WordPress sidebar look and feel, in the backend
    • The Adminimize plugin, for customizing the WordPress admin area, for different users

    Kindly note that this forum is dedicated to supporting the core WooCommerce functionality, and that of the two plugins mentioned above, as well as that of “User Role Editor”, have their own dedicated forums. The support forum for “User Role Editor” can be found linked below:

    https://www.ads-software.com/support/plugin/user-role-editor/

    I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.

    Thread Starter maxence1502

    (@maxence1502)

    Thank you ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Role that can ONLY add/edit products’ is closed to new replies.