Opened 7 years ago
Closed 6 years ago
#41439 closed defect (bug) (fixed)
A super admin cannot remove themselves from a site
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Users | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
A super admin cannot remove themselves from a site, either from the Users
listing screen in the site's dashboard or from the Users
tab when editing the site. There's no reason to prevent this from being possible.
Attachments (1)
Change History (6)
This ticket was mentioned in Slack in #core-multisite by desrosj. View the logs.
7 years ago
#3
@
6 years ago
- Keywords has-patch added; needs-patch removed
I have added a simple patch, just removing the condition which said that a current user could not remove itself from a site.
Working well for me
Note: See
TracTickets for help on using
tickets.
Here's the restriction in
WP_Users_List_Table::single_row()
that prevents the current users to delete themselves from the current site:https://github.com/WordPress/WordPress/blob/067970ca827ab970c846b522213a15c9c30ac131/wp-admin/includes/class-wp-users-list-table.php#L416
If I understand correctly we want to allow this removal for the super admin only, maybe with:
or check for the
manage_network_users
capability instead ofmanage_network
?I see no removal restrictions, for the current user, in
wp-admin/network/site-users.php
:https://github.com/WordPress/WordPress/blob/067970ca827ab970c846b522213a15c9c30ac131/wp-admin/network/site-users.php#L112-L133