update cap handling for new page controller

This commit is contained in:
Ron Rennick 2019-05-14 15:31:03 -03:00
parent e68eaabaac
commit 15b3bd55ec
2 changed files with 7 additions and 5 deletions

View File

@ -142,12 +142,14 @@ class WC_Admin_Loader {
* @todo The entry point for the embed needs moved to this class as well.
*/
public static function register_page_handler() {
$analytics_cap = apply_filters( 'woocommerce_admin_analytics_menu_capability', 'view_woocommerce_reports' );
wc_admin_register_page(
array(
'id' => 'woocommerce-dashboard', // Expected to be overridden if dashboard is enabled.
'parent' => 'woocommerce',
'title' => null,
'path' => self::APP_ENTRY_POINT,
'id' => 'woocommerce-dashboard', // Expected to be overridden if dashboard is enabled.
'parent' => 'woocommerce',
'title' => null,
'path' => self::APP_ENTRY_POINT,
'capability' => $analytics_cap,
)
);

View File

@ -398,7 +398,7 @@ class WC_Admin_Page_Controller {
'id' => null,
'parent' => null,
'title' => '',
'capability' => 'manage_options',
'capability' => 'view_woocommerce_reports',
'path' => '',
'icon' => '',
'position' => null,