• Resolved Sai Praveen

    (@saip1540)


    Hi

    I have created a user role called Shop Manager where he will have access to the woo commerce , we have also have a membership in our website and also how can I give access to users edit option where he can edit the user , remove or delete it , or how can he delete or change the membership for set of users in the website.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    In order edit users user role should can ‘list_users’, ‘edit_users’, ‘delete_users’ user capabilities.

    Starting from version 3.4.6 WC shop_manager can edit users with ‘customer’ role only, but it’s possible to change via offered custom filter:
    https://developer.woocommerce.com/2018/10/11/woocommerce-3-4-6-security-fix-release-notes/

    How to delete or change membership depends from what membership plugin do you use.

    Thread Starter Sai Praveen

    (@saip1540)

    Lets Say I have a Shop Manager role and for that role I want to assign edit user option. That means they can edit the user details similar how admin will have access in the backend.

    Usually as per the roles setting I have enabled checkbox options for the users setting like read, edit ,view and delete. Accept the edit option rest all are showing like view the user or delete the user like that. Is there anything else I need to enable.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Yes, you need. By default WooCommerce allows shop manager edit only users with customer role. In order to change this extend the list via custom filter

    https://woocommerce.wordpress.com/2018/10/11/woocommerce-3-4-6-security-fix-release-notes/

    Thread Starter Sai Praveen

    (@saip1540)

    As per the link given above if I add the code. It will enable the shop manager to edit the users as well right.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Yes. You may look at the users with a customer role. Shop manager can edit them currently. Editing all other users is blocked for security reasons. Add to the list of editable roles those, users with which you wish allow to edit for shop manager and it should solve your task.

    Thread Starter Sai Praveen

    (@saip1540)

    I have tried adding the code in functions.php. Once I have added I have crossed check with user details wether that user is getting edit option where he can edit user details for others users but unfortunately he is not getting.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    I suppose test user has shop_manager role and you granted to it (if absent) list_users, edit_users capabilities.

    Without additional code: Test user with conditions above should can edit another user with ‘customer’ role. Does he?

    If you add exactly code from the link above: test user should can edit other users with ‘editor’ role in addition to users with ‘customer’ role. Does he?

    Pay attention code will allow to user edit only users with customer role and roles which you add via that code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to give edit user permission for a specific role in User Roles’ is closed to new replies.