public function update_item_permissions_check($request)
{
$post = get_post($request['id']);
if ($post && !wc_rest_check_post_permissions($this->post_type, 'edit', $post->ID)) {
return new WP_Error('woocommerce_rest_cannot_edit', __('Sorry, you are not allowed to edit this resource.', 'woocommerce'), array('status' => rest_authorization_required_code()));
}
return true;
}