• Regarding this statement:
    If you know what you’re doing with user capabilities, this (switch_users) capability can also be denied from a user or role to prevent the ability to switch users, regardless of whether or not they have the edit_users capability.

    I attempted to add the switch_users capability via User Role Editor and then deselect it for a specific role. This role needs to be able to add and edit users but not switch to a different user. However, this method didn’t work. Is this the right syntax for the capability? I guess it may be necessary to do this via the functions file but wanted to check first. Any advice would be appreciated. Thanks for this plugin. It’s amazing.

    Diane

Viewing 1 replies (of 1 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I’m not familiar with the User Role Editor plugin, but in the Members plugin for example it provides an explicit checkbox for denying a capability.

    Does User Role Editor provide the same thing? If not, you might find that it’s simply not granting the role instead of explicitly denying it.

    I think I need to add some more documentation around this because it’s a fairly common request. I’ll dig out some example code.

Viewing 1 replies (of 1 total)
  • The topic ‘Deny switch_users capability’ is closed to new replies.