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/API/V2/Proxy/Taxes_Proxy_Behavior.php +6 -9 1.10.101.10.18 View file →
@@ -12,8 +12,14 @@
12 12 /**
13 13 * Applies tax ID narrowing and POS read permission without a v1 controller.
14 14 */
15 15 final class Taxes_Proxy_Behavior extends Scoped_Proxy_Behavior {
16 + /** POS read grant for this collection only.
17 + *
18 + * @var string
19 + */
20 + protected $permission_collection = 'tax_rates';
21 +
16 22 /**
17 23 * The Collection Rules plan for the request in flight.
18 24 *
19 25 * @var int[]
@@ -53,17 +59,8 @@
53 59 * @return array<int, array{0: string, 1: callable, 2: int}>
54 60 */
55 61 protected function install(): array {
56 62 $bindings = array();
57 - $permission = static function ( $allowed, $context, $object_id, $post_type ) {
58 - if ( ! $allowed && 'settings' === $post_type && 'read' === $context ) {
59 - $allowed = current_user_can( 'access_woocommerce_pos' );
60 - }
61 -
62 - return $allowed;
63 - };
64 - add_filter( 'woocommerce_rest_check_permissions', $permission, 10, 4 );
65 - $bindings[] = array( 'woocommerce_rest_check_permissions', $permission, 10 );
66 63
67 64 if ( array() === $this->include && array() === $this->exclude ) {
68 65 return $bindings;
69 66 }