Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#39212 closed enhancement (fixed)

Replace is_super_admin() check with current_user_can( 'manage_network_users' ) in wp-admin/includes/ms.php

Reported by: bhargavbhandari90's profile bhargavbhandari90 Owned by: flixos90's profile flixos90
Milestone: 4.8 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: has-patch
Focuses: multisite Cc:

Description

This is part of the #37616 task. There are 1 is_super_admin() checks in wp-admin/includes/ms.php that should be replaced with current_user_can( 'manage_network_users' ).

Attachments (2)

39212.patch (411 bytes) - added by bhargavbhandari90 7 years ago.
39212-2.patch (508 bytes) - added by bhargavbhandari90 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 follow-up: @flixos90
7 years ago

  • Focuses multisite added
  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 4.8
  • Owner set to flixos90
  • Status changed from new to reviewing

Thanks for the patch @bhargavbhandari90! It looks good so far, there are only two small adjustments that should be made, which are both related to coding standards:

  • insert a space between the ! and current_user_can( 'manage_network_users' )
  • add curly braces around the clause (this is an acceptable change since we are adjusting that code anyway)

#2 in reply to: ↑ 1 @bhargavbhandari90
7 years ago

Replying to flixos90:

Thanks for the patch @bhargavbhandari90! It looks good so far, there are only two small adjustments that should be made, which are both related to coding standards:

  • insert a space between the ! and current_user_can( 'manage_network_users' )
  • add curly braces around the clause (this is an acceptable change since we are adjusting that code anyway)

Thanks for the update. I have created another patch.

#3 follow-up: @flixos90
7 years ago

  • Keywords needs-refresh removed

Great, thanks a lot @bhargavbhandari90 - looks good! :)

#4 in reply to: ↑ 3 @bhargavbhandari90
7 years ago

Replying to flixos90:

Great, thanks a lot @bhargavbhandari90 - looks good! :)

Thanks. :-)

#5 @flixos90
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 39945:

Multisite: Replace is_super_admin() with manage_network_users when trying to import new users.

Props bhargavbhandari90.
Fixes #39212. See #37616.

Note: See TracTickets for help on using tickets.