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:
parent
26e7588d7d
commit
586d471001
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue