← All changes
|
includes/API/V2/Proxy/Scoped_Proxy_Behavior.php
+0
-13
1.10.22
→
1.10.17
View file →
| @@ -6,9 +6,8 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace WCPOS\WooCommercePOS\API\V2\Proxy; |
| 9 | 9 | |
| 10 | -use WCPOS\WooCommercePOS\Services\Permission_Rules; | |
| 11 | 10 | use WP_REST_Request; |
| 12 | 11 | |
| 13 | 12 | /** |
| 14 | 13 | * Gives every resource the same install/run/finally/unwind discipline. |
| @@ -13,14 +12,8 @@ | ||
| 13 | 12 | /** |
| 14 | 13 | * Gives every resource the same install/run/finally/unwind discipline. |
| 15 | 14 | */ |
| 16 | 15 | abstract class Scoped_Proxy_Behavior implements Proxy_Behavior { |
| 17 | - /** Permission collection, when this resource has a POS-tier read grant. | |
| 18 | - * | |
| 19 | - * @var string|null | |
| 20 | - */ | |
| 21 | - protected $permission_collection; | |
| 22 | - | |
| 23 | 16 | /** |
| 24 | 17 | * Forward every param untouched. |
| 25 | 18 | * |
| 26 | 19 | * @param array $params Query parameters to forward. |
| @@ -40,18 +33,12 @@ | ||
| 40 | 33 | * @return mixed |
| 41 | 34 | */ |
| 42 | 35 | public function around( callable $forward ) { |
| 43 | 36 | $bindings = $this->install(); |
| 44 | - if ( $this->permission_collection ) { | |
| 45 | - Permission_Rules::install_wc_filter( $this->permission_collection ); | |
| 46 | - } | |
| 47 | 37 | |
| 48 | 38 | try { |
| 49 | 39 | return $this->run( $forward ); |
| 50 | 40 | } finally { |
| 51 | - if ( $this->permission_collection ) { | |
| 52 | - Permission_Rules::uninstall_wc_filter(); | |
| 53 | - } | |
| 54 | 41 | foreach ( array_reverse( $bindings ) as $binding ) { |
| 55 | 42 | remove_filter( $binding[0], $binding[1], $binding[2] ); |
| 56 | 43 | } |
| 57 | 44 | } |