Skip Navigation

[Resolved] Delete Users of only lower role

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Ian 7 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#533436

Ian

I have created a user role of "Manager" based on editor.

Under permissions I want to grant them the ability to delete users. This works fine but a manager is able to delete any admin or editor.

Is there a way to restrict the Manager to only delete users of roles lesser than their own?

#533581

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - at this point you need to check user capabilities and based on that you can allow/deny the deletion and add your logic. Indeed - this requires custom programming and let me admit that that is eventually beyond the scope of our support policy.

Still - I can show you the way that might help you to achieve your goal. Please check following solution:
=> https://wordpress.stackexchange.com/questions/188863/how-to-allow-an-user-role-to-create-a-new-user-under-a-role-which-lower-than-his

If you need custom programming for your project - please feel free to contact our certified partners.
=> https://toolset.com/consultant/

#533816

Ian

Thanks that should be fairly straight forward.

This would probably be worth exploring as an update to Access

  • many people use it to modify administrative roles
  • being able to delete users of a higher role is a security issue

sub checkboxes under "remove_users" would be an ideal interface for those who don't code.

Thanks again.

-Ian