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`
This commit is contained in:
Tomek Wytrębowicz 2023-02-18 19:39:58 +01:00
parent 26e7588d7d
commit 586d471001
1 changed files with 0 additions and 15 deletions

View File

@ -31,21 +31,6 @@ class Controller extends \WC_REST_Reports_Controller {
*/ */
protected $rest_base = 'reports'; 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. * Get all reports.
* *