Replace `is_super_admin()` checks with `manage_network` cap checks for `get_dashboard_url()`
|Reported by:||flixos90||Owned by:||flixos90|
|Component:||Role/Capability||Keywords:||has-patch has-unit-tests commit|
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.
Change History (9)
- Keywords has-unit-tests added
- Owner set to flixos90
- Status changed from new to assigned