diff --git a/includes/API/Data_Order_Statuses_Controller.php b/includes/API/Data_Order_Statuses_Controller.php index 13c484c..eb92bd3 100644 --- a/includes/API/Data_Order_Statuses_Controller.php +++ b/includes/API/Data_Order_Statuses_Controller.php @@ -135,4 +135,17 @@ public function get_item_schema() { return $this->add_additional_fields_schema( $schema ); } + + /** + * Check whether a given request has permission to view order statuses. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( is_user_logged_in() ) { + return true; + } + return parent::get_items_permissions_check( $request ); + } } diff --git a/includes/API/Shipping_Methods_Controller.php b/includes/API/Shipping_Methods_Controller.php index 7f5d3f0..1a777db 100644 --- a/includes/API/Shipping_Methods_Controller.php +++ b/includes/API/Shipping_Methods_Controller.php @@ -24,4 +24,17 @@ class Shipping_Methods_Controller extends WC_REST_Shipping_Methods_Controller { * @var string */ protected $namespace = 'wcpos/v1'; + + /** + * Check whether a given request has permission to view shipping methods. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( is_user_logged_in() ) { + return true; + } + return parent::get_items_permissions_check( $request ); + } } diff --git a/includes/API/Tax_Classes_Controller.php b/includes/API/Tax_Classes_Controller.php index d40a335..b928817 100644 --- a/includes/API/Tax_Classes_Controller.php +++ b/includes/API/Tax_Classes_Controller.php @@ -24,4 +24,17 @@ class Tax_Classes_Controller extends WC_REST_Tax_Classes_Controller { * @var string */ protected $namespace = 'wcpos/v1'; + + /** + * Check whether a given request has permission to view tax classes. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( is_user_logged_in() ) { + return true; + } + return parent::get_items_permissions_check( $request ); + } } diff --git a/package.json b/package.json index 15d73f0..a4c93c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wcpos/woocommerce-pos", - "version": "1.5.0", + "version": "1.5.1", "description": "A simple front-end for taking WooCommerce orders at the Point of Sale.", "main": "index.js", "workspaces": { diff --git a/readme.txt b/readme.txt index 83d85fe..858b74f 100644 --- a/readme.txt +++ b/readme.txt @@ -79,6 +79,10 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co == Changelog == += 1.5.1 - 2024/06/03 = +* Fix: "Sorry, you cannot list resources." error for cashier role + + = 1.5.0 - 2024/06/03 = * Fix: the POS will now correctly sync stock quantity after each sale * Fix: cart tax logic has been improved to fix rounding issues diff --git a/woocommerce-pos.php b/woocommerce-pos.php index 983228e..8046e6b 100644 --- a/woocommerce-pos.php +++ b/woocommerce-pos.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce POS * Plugin URI: https://wordpress.org/plugins/woocommerce-pos/ * Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires WooCommerce. - * Version: 1.5.0 + * Version: 1.5.1 * Author: kilbot * Author URI: http://wcpos.com * Text Domain: woocommerce-pos @@ -26,7 +26,7 @@ namespace WCPOS\WooCommercePOS; // Define plugin constants. -const VERSION = '1.5.0'; +const VERSION = '1.5.1'; const PLUGIN_NAME = 'woocommerce-pos'; const SHORT_NAME = 'wcpos'; \define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'