WordPress.org

Forums

Members
how do I keep the clients from creating admins? (6 posts)

  1. marisaporter
    Member
    Posted 2 years ago #

    I have created a new role called Recruiter that has access to users and their files. They can also add new users, but not delete, that's it. I've also hidden the admin from that role's admin panel.

    But they can create admins. This is obviously not desirable. How do I keep them from creating admins? Thanks!!!

    http://wordpress.org/extend/plugins/members/

  2. marisaporter
    Member
    Posted 2 years ago #

    Here is the answer: I found the answer and wrote about it in my blog.

    http://marisaporter.com/keep-clients-from-creating-administrators/

  3. Shashank Shekhar
    Member
    Posted 2 years ago #

    So many thanks for posting your solution here. I have checked its working. It removed the edit, delete links from users list and also removed the administrator role from dropdown to prevent promoting users to higher level.
    But one thing still there, its still able to list the administrator users in users list. What should be added more in the solution to hide the upper level admin to not come in the list on All Users -> http://site.com/wp-admin/users.php for ex.?

  4. marisaporter
    Member
    Posted 2 years ago #

    I'm not quite following. The desired outcome is to remove the administrators from the list of users on any login that is not the administrator.

    When I am logged in as an administrator, or anyone else who is an administrator is logged in, they can see the admins. If they are not admins, they cannot see any admins at all.

    Hope that makes sense.

  5. Shashank Shekhar
    Member
    Posted 2 years ago #

    Yes I want 'To remove the administrators from the list of users on any login that is not the administrator.' Here removal means only to not able to see the administrator by other user roles.
    For example, if an editor logged-in in wp-admin he will see all users in wordpress normally, but I want a way so that other users will available in list excluding administrator (i.e. hidden administrator users).

    I hope it is clear to you now.
    By the way, I found the solution for what I want, here:
    http://wordpress.stackexchange.com/questions/10742/remove-ability-for-other-users-to-view-administrator-in-user-list
    http://wordpress.stackexchange.com/questions/47743/hide-one-admin-from-another-admin
    using 'pre_user_query' action.

    I put this function below yours JPB_User_Caps class code and it all done in total !! :)
    But above function is limited to hide the particular admin using id or username. Can this converted in some way to check on basis of 'administrator' capability to hide all 'administrator' role users?
    Further I am thinking, to put this extended action inside your class or map_meta_cap function in additional switch case.. whatever ?

    Could you help me in this?

  6. Ardibee
    Member
    Posted 2 years ago #

    Nice work marisqua and Shashank! Any way to extend this logic to buddypress group admins? In other words, have a local admin for each BP group that can create lower-privileged users within that group but not grant membership to other groups?

    Any way of achieving the same thing as you're describing above with the Members plug-in?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Members
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic