Change WordPress user roles and capabilities › Forums › Bug Reports › User delete/edit permission not working for custom role
Tagged: edit users
- This topic has 6 replies, 2 voices, and was last updated 2 years, 10 months ago by Vladimir.
08/07/2020 at 09:35 #6943
Hi! I am using the Plugin to specify a “Shop Manager” role for WooCommerce, and i activated all User editing permissions for that role. It should be possible for that role to delete WordPress users, or edit their (address/billing) data. But if I login with that user and try to delete a user (by selecting him and choosing the delete bulk action), there is a confirm button – after pressing it, i get an error that I do not have the permission for this. The user to delete/edit would be a regular customer, no special role like Administrator.
Is there something I am missing?
Btw, editing the orders including user data is possible for the role, but I need him to be able to change the default data for users that is visible in the default WordPress user overview.
Also, i would like to allow that “Shop Manager” role to edit user roles (only specific ones, for example, to switch a user between “customer” and “B2B”), but it seems that it is not possible either? I could not find any specific permission for it, but it should be included in the user_edit permissions, I guess.
Also, is there a permission to allow the integrated WP tool to erase personal data for data privacy, or can i just use this as Administrator?10/07/2020 at 10:39 #6944
My test showed that shop_manager with ‘list_users’, ‘edit_users’, ‘delete_users’ capabilities’ can delete selected user with ‘customer’ role successfully. Test user was just created and did not have orders though. Does customer have orders in your case?
Try to deactivate all plugins except WooCommerce. Will shop_manager can delete user then?10/07/2020 at 10:42 #6945
Look at this topic for information how to add other roles to the list of roles available for shop_manager for editing/selection.10/07/2020 at 10:46 #6946
Menu item “Tools->Erase personal data” is protected by virtual user capability ‘erase_others_personal_data’. WordPress maps it by default to ‘manage_network’ for multisite and ‘manage_options’ for single site installation.
User Role Editor Pro can change this:
Try to turn ON the “Privacy related (manage_privacy_options, export_others_personal_data, erase_others_personal_data)” option at the “Settings->User Role Editor->Additional Modules” tab. Grant ‘erase_others_personal_data’ capability to your role then. Will it help?13/07/2020 at 12:05 #6949
hi! thank you, the tip with the external link was the key to success for editing and deleting users. i am using the plugins german market and b2b market, they add customer roles with german roles, so i had to add the german roles to the allowed roles for shop managers.
will keep you in the loop about the privacy thing, thank you again!13/07/2020 at 13:44 #6952
your tip about the privacy setting helped too, thank you! i am able to erase personal data as shop manager too 🙂13/07/2020 at 15:57 #6955
Excellent! Thanks for the feedback.
- You must be logged in to reply to this topic.