[wp-trac] [WordPress Trac] #60029: Admin unable to create new Application Password for user with no role on main site (multisite)
WordPress Trac
noreply at wordpress.org
Wed Apr 2 13:14:53 UTC 2025
#60029: Admin unable to create new Application Password for user with no role on
main site (multisite)
--------------------------------------+------------------------------
Reporter: roytanck | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Application Passwords | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: multisite
--------------------------------------+------------------------------
Comment (by roytanck):
This issue seems to boil down to this bit in wp-includes/rest-
api/endpoints/class-wp-rest-application-passwords-controller.php (line
722).
{{{#!php
<?php
if ( is_multisite() && ! user_can( $user->ID, 'manage_sites' ) && !
is_user_member_of_blog( $user->ID ) ) {
return $error;
}
}}}
If we could replace the call to `is_user_member_of_blog` with a function
that checks for roles on ''any'' blog within the network, that would
likely fix the issue. I don't think such a function currently exists?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60029#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list