Opened 8 years ago
Closed 8 years ago
#39199 closed enhancement (fixed)
Replace `is_super_admin()` checks with `manage_network` cap checks in wp-includes/option.php
Reported by: | chandrapatel | Owned by: | 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 2 is_super_admin() checks in wp-includes/option.php that should be replaced with current_user_can( 'manage_network' ).
Attachments (2)
Change History (10)
#1
@
8 years ago
Hello,
Please ignore 39199.patch file. I've uploaded wrong patch. I am sorry.
Correct one is 39199.1.patch
#3
@
8 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.8
- Owner set to flixos90
- Status changed from new to assigned
- Type changed from defect (bug) to enhancement
Thanks for the patch @chandrapatel - looking good!
#4
@
8 years ago
- Keywords 2nd-opinion added
The capability check here looks redundant. I think it can be removed and leave just the ! is_user_member_of_blog()
check.
#5
@
8 years ago
- Keywords needs-refresh added; 2nd-opinion removed
I agree with @johnbillion that the check is redundant. The check was introduced in 22256 to prevent the user settings from being set for a super admin who is not a member of the site. I think it makes sense for this restriction to exist for any kind of user, so we should be able to remove the check.
I noticed that this would also affect wp-admin/includes/dashboard.php
line 490 - for some reason we missed this is_super_admin()
occurrence entirely before, but it has exactly the same purpose like the ones in this ticket, so we can deal with it in here too.
Replaced is_super_admin() with current_user_can( 'manage_network' )