From 586d4710010ce0b85b85a30e2408bcd6a1c5e240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Sat, 18 Feb 2023 19:39:58 +0100 Subject: [PATCH] Remove `get_items_permissions_check` from `Reports\Controller`, as it is implemented in the exact same shape in its parent class- `WC_REST_Reports_V1_Controller` --- .../src/Admin/API/Reports/Controller.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/plugins/woocommerce/src/Admin/API/Reports/Controller.php b/plugins/woocommerce/src/Admin/API/Reports/Controller.php index da1bc3992eb..fd3eadf7792 100644 --- a/plugins/woocommerce/src/Admin/API/Reports/Controller.php +++ b/plugins/woocommerce/src/Admin/API/Reports/Controller.php @@ -31,21 +31,6 @@ class Controller extends \WC_REST_Reports_Controller { */ protected $rest_base = 'reports'; - /** - * Check whether a given request has permission to read reports. - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|boolean - */ - public function get_items_permissions_check( $request ) { - if ( ! wc_rest_check_manager_permissions( 'reports', 'read' ) ) { - return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } - - /** * Get all reports. *