PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.18
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.18
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
← All changes | includes/Templates/Frontend.php +4 -3 1.10.81.10.18 View file →
@@ -10,8 +10,9 @@
10 10
11 11 namespace WCPOS\WooCommercePOS\Templates;
12 12
13 13 use WCPOS\WooCommercePOS\Services\Auth;
14 +use WCPOS\WooCommercePOS\Services\Cashier;
14 15 use WCPOS\WooCommercePOS\Services\Lifecycle_Events;
15 16 use WCPOS\WooCommercePOS\Services\Settings;
16 17 use WCPOS\WooCommercePOS\Sync\Pos_Uuid;
17 18 use WCPOS\WooCommercePOS\Template_Router;
@@ -53,11 +54,11 @@
53 54 auth_redirect();
54 55 }
55 56
56 57 // check privileges.
57 - if ( ! current_user_can( 'access_woocommerce_pos' ) ) {
58 - // translators: Authorization error shown when a logged-in user lacks permission to open the POS page.
59 - wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'woocommerce-pos' ) );
58 + $user = wp_get_current_user();
59 + if ( ! Cashier::instance()->can_open_pos( $user ) ) {
60 + wp_die( esc_html( Cashier::instance()->missing_pos_capabilities_message( $user ) ), '', array( 'response' => 403 ) );
60 61 }
61 62
62 63 // disable cache plugins.
63 64 $this->no_cache();