Skip to content

Commit 9eea9f8

Browse files
committed
Fix: "Sorry, you cannot list resources." error for cashier role
1 parent ebc94d4 commit 9eea9f8

File tree

6 files changed

+46
-3
lines changed

6 files changed

+46
-3
lines changed

includes/API/Data_Order_Statuses_Controller.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,17 @@ public function get_item_schema() {
135135

136136
return $this->add_additional_fields_schema( $schema );
137137
}
138+
139+
/**
140+
* Check whether a given request has permission to view order statuses.
141+
*
142+
* @param WP_REST_Request $request Full details about the request.
143+
* @return WP_Error|boolean
144+
*/
145+
public function get_items_permissions_check( $request ) {
146+
if ( is_user_logged_in() ) {
147+
return true;
148+
}
149+
return parent::get_items_permissions_check( $request );
150+
}
138151
}

includes/API/Shipping_Methods_Controller.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,17 @@ class Shipping_Methods_Controller extends WC_REST_Shipping_Methods_Controller {
2424
* @var string
2525
*/
2626
protected $namespace = 'wcpos/v1';
27+
28+
/**
29+
* Check whether a given request has permission to view shipping methods.
30+
*
31+
* @param WP_REST_Request $request Full details about the request.
32+
* @return WP_Error|boolean
33+
*/
34+
public function get_items_permissions_check( $request ) {
35+
if ( is_user_logged_in() ) {
36+
return true;
37+
}
38+
return parent::get_items_permissions_check( $request );
39+
}
2740
}

includes/API/Tax_Classes_Controller.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,17 @@ class Tax_Classes_Controller extends WC_REST_Tax_Classes_Controller {
2424
* @var string
2525
*/
2626
protected $namespace = 'wcpos/v1';
27+
28+
/**
29+
* Check whether a given request has permission to view tax classes.
30+
*
31+
* @param WP_REST_Request $request Full details about the request.
32+
* @return WP_Error|boolean
33+
*/
34+
public function get_items_permissions_check( $request ) {
35+
if ( is_user_logged_in() ) {
36+
return true;
37+
}
38+
return parent::get_items_permissions_check( $request );
39+
}
2740
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wcpos/woocommerce-pos",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
55
"main": "index.js",
66
"workspaces": {

readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co
7979

8080
== Changelog ==
8181

82+
= 1.5.1 - 2024/06/03 =
83+
* Fix: "Sorry, you cannot list resources." error for cashier role
84+
85+
8286
= 1.5.0 - 2024/06/03 =
8387
* Fix: the POS will now correctly sync stock quantity after each sale
8488
* Fix: cart tax logic has been improved to fix rounding issues

woocommerce-pos.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce POS
44
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/
55
* Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
6-
* Version: 1.5.0
6+
* Version: 1.5.1
77
* Author: kilbot
88
* Author URI: http://wcpos.com
99
* Text Domain: woocommerce-pos
@@ -26,7 +26,7 @@
2626
namespace WCPOS\WooCommercePOS;
2727

2828
// Define plugin constants.
29-
const VERSION = '1.5.0';
29+
const VERSION = '1.5.1';
3030
const PLUGIN_NAME = 'woocommerce-pos';
3131
const SHORT_NAME = 'wcpos';
3232
\define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'

0 commit comments

Comments
 (0)