Opened 10 years ago
Closed 10 years ago
#39201 closed enhancement (fixed)
Replace current_user_can( 'manage_network_users' ) in wp-admin/includes/ajax-actions.php and wp-admin/user-new.php (line 228)
| Reported by: | ashokkumar24 | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.8 |
| Component: | Role/Capability | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
Description
This is part of the #37616 task. There are 2 is_super_admin() checks in wp-includes/option.php that should be replaced with current_user_can( 'manage_network' ).
Attachments (1)
Change History (6)
#1
in reply to: ↑ description
@
10 years ago
Replying to ashokkumar24:
This is part of the #37616 task. current_user_can( 'manage_network_users' ) in wp-admin/includes/ajax-actions.php and wp-admin/user-new.php.
#2
@
10 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 4.8
- Owner set to
- Status new → assigned
- Type defect (bug) → enhancement
Hi @ashokkumar24, and thanks for the patch - looks good!
#3
follow-up:
↓ 4
@
10 years ago
The logic in src/wp-admin/user-new.php now includes two capability checks:
is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )
Need to determine if both are actually needed here.
#4
in reply to: ↑ 3
@
10 years ago
Replying to johnbillion:
The logic in
src/wp-admin/user-new.phpnow includes two capability checks:
is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )Need to determine if both are actually needed here.
I agree that it looks a bit uncommon to have two capability checks in one clause, but since the second is in a separate OR check, I think it should remain like that. This is also necessary to keep backward compatibility as the second capability check replaces is_super_admin() (or now rather detects whether the user has caps to manage network-wide users).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Replace current_user_can( 'manage_network_users' ) in wp-admin/includes/ajax-actions.php and wp-admin/user-new.php