# woocommerce-pos/1.10.18/includes/API/V2/Proxy/Scoped_Proxy_Behavior.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.18. 91 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/code/includes/API/V2/Proxy/Scoped_Proxy_Behavior.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/raw/includes/API/V2/Proxy/Scoped_Proxy_Behavior.php
- Modified: 2026-09-18T11:11:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/code/includes/API/V2/Proxy/Scoped_Proxy_Behavior.php#L10-L20`.

```php
<?php
/**
 * Scoped catalog proxy behavior base.
 *
 * @package WCPOS\WooCommercePOS\API\V2\Proxy
 */

namespace WCPOS\WooCommercePOS\API\V2\Proxy;

use WCPOS\WooCommercePOS\Services\Permission_Rules;
use WP_REST_Request;

/**
 * Gives every resource the same install/run/finally/unwind discipline.
 */
abstract class Scoped_Proxy_Behavior implements Proxy_Behavior {
	/** Permission collection, when this resource has a POS-tier read grant.
	 *
	 * @var string|null
	 */
	protected $permission_collection;

	/**
	 * Forward every param untouched.
	 *
	 * @param array           $params  Query parameters to forward.
	 * @param WP_REST_Request $request Original proxy request.
	 *
	 * @return array
	 */
	public function forwarded_params( array $params, WP_REST_Request $request ): array {
		return $params;
	}

	/**
	 * Install this resource's hooks, run the forward, and always unwind.
	 *
	 * @param callable $forward Forward operation.
	 *
	 * @return mixed
	 */
	public function around( callable $forward ) {
		$bindings = $this->install();
		if ( $this->permission_collection ) {
			Permission_Rules::install_wc_filter( $this->permission_collection );
		}

		try {
			return $this->run( $forward );
		} finally {
			if ( $this->permission_collection ) {
				Permission_Rules::uninstall_wc_filter();
			}
			foreach ( array_reverse( $bindings ) as $binding ) {
				remove_filter( $binding[0], $binding[1], $binding[2] );
			}
		}
	}

	/**
	 * Return the response data unshaped.
	 *
	 * @param mixed $data Response data.
	 *
	 * @return mixed
	 */
	public function post_process( $data ) {
		return $data;
	}

	/**
	 * Install hooks and return their exact removal tuples.
	 *
	 * @return array<int, array{0: string, 1: callable, 2: int}>
	 */
	protected function install(): array {
		return array();
	}

	/**
	 * Run the forward, optionally through a resource plan.
	 *
	 * @param callable $forward Forward operation.
	 *
	 * @return mixed
	 */
	protected function run( callable $forward ) {
		return $forward();
	}
}

```
