Application Passwords: Allow a Super Admin to set an application password on a site they're not a member of.

This removes the requirement that a Super Admin must be a member of the current site when they attempt to set an application password within the admin area of an individual site on the network.

Props TimothyBlynJacobs, ilovecats7, johnbillion, georgestephanis, johnjamesjacoby

Fixes #53224

Built from https://develop.svn.wordpress.org/trunk@53882


git-svn-id: http://core.svn.wordpress.org/trunk@53441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2022-08-11 18:24:09 +00:00
parent 41b3519fbe
commit c1db3198ce
2 changed files with 2 additions and 2 deletions

View File

@ -719,7 +719,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
return $error;
}
if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) {
if ( is_multisite() && ! user_can( $user->ID, 'manage_sites' ) && ! is_user_member_of_blog( $user->ID ) ) {
return $error;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53881';
$wp_version = '6.1-alpha-53882';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.