[wp-trac] [WordPress Trac] #39065: Replace `is_super_admin()` checks with `manage_network` cap checks for `get_dashboard_url()`

WordPress Trac noreply at wordpress.org
Sun Dec 4 18:56:41 UTC 2016


#39065: Replace `is_super_admin()` checks with `manage_network` cap checks for
`get_dashboard_url()`
-----------------------------+-----------------
 Reporter:  flixos90         |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  4.8
Component:  Role/Capability  |    Version:
 Severity:  normal           |   Keywords:
  Focuses:  multisite        |
-----------------------------+-----------------
 This is part of the #37616 task. The two `is_super_admin()` checks in
 `get_dashboard_url()` should be replaced by `user_can( $user_id,
 'manage_network' )` which is a suitable cap here. In addition to the
 mentioned ticket's goals, this fixes a possible bug since one of the two
 checks does not actually pass the `$user_id` to `is_super_admin()` which
 would always check for the current user instead of the ID passed to the
 function.

 Since there are no unit tests for `get_dashboard_url()`, these should be
 added as well.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39065>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list