fix: connections only manageable for users the admin may edit
This commit is contained in:
@@ -87,9 +87,17 @@ class ConnectionRepository
|
||||
return \WP_Application_Passwords::delete_application_password($userId, $uuid) === true;
|
||||
}
|
||||
|
||||
/** Whether the current administrator may see and revoke this user's connections. */
|
||||
/**
|
||||
* Whether the current administrator may see and revoke this user's connections: only for
|
||||
* users they may edit (edit_user, as for application passwords in the profile), and on
|
||||
* multisite only members of this site, super admins only for other super admins.
|
||||
*/
|
||||
private function manageable(int $userId): bool
|
||||
{
|
||||
if (! current_user_can('edit_user', $userId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! is_multisite()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user