Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#39204 closed enhancement (fixed)

Replace `is_super_admin()` check with `manage_network_users` cap check in wp-admin/users.php

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

Description (last modified by flixos90)

This is part of the #37616 task. There is 1 is_super_admin() check in wp-admin/users.php that should be replaced with current_user_can( 'manage_network_users' ).
See https://core.trac.wordpress.org/ticket/37616#comment:28

Attachments (2)

39204.patch (1.5 KB) - added by abhishek kaushik 8 years ago.
Replaced is_super_admin() with current_user_can( 'manage_network' )
39204_1.patch (776 bytes) - added by abhishek kaushik 8 years ago.
Replaced is_super_admin() with current_user_can( 'manage_network' ) on for first occurrence

Download all attachments as: .zip

Change History (6)

@abhishek kaushik
8 years ago

Replaced is_super_admin() with current_user_can( 'manage_network' )

#1 @flixos90
8 years ago

  • Description modified (diff)
  • Focuses administration removed
  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 4.8
  • Owner set to flixos90
  • Status changed from new to reviewing
  • Summary changed from Replace `is_super_admin()` checks with `manage_network` cap checks in wp-admin/users.php to Replace `is_super_admin()` check with `manage_network_users` cap check in wp-admin/users.php
  • Type changed from defect (bug) to enhancement
  • Version trunk deleted

Hi @abhishek kaushik, and thanks for the patch! It generally looks good, it just does a little too much. Only the first occurrence of is_super_admin() (in line 125) should be replaced here, the other two are already handled in #39063. Would you mind updating your patch accordingly? :)

#2 @abhishek kaushik
8 years ago

no problem @flixos90 adding another patch

@abhishek kaushik
8 years ago

Replaced is_super_admin() with current_user_can( 'manage_network' ) on for first occurrence

#3 @flixos90
8 years ago

  • Keywords needs-refresh removed

Thanks @abhishek kaushik, looks good now!

#4 @flixos90
8 years ago

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

In 39943:

Multisite: Replace is_super_admin() with manage_network_users when trying to change the role of oneself.

Props abhishek kaushik.
Fixes #39204. See #37616.

Note: See TracTickets for help on using tickets.