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.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 1.9.13 All 162 releases
woocommerce-pos / includes / Services / Customer_Account_Guard.php

Customer_Account_Guard.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.18, at includes/Services/Customer_Account_Guard.php

59 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Backward-compatible staff guard API.
4 *
5 * @package WCPOS\WooCommercePOS
6 */
7
8 namespace WCPOS\WooCommercePOS\Services;
9
10 /**
11 * Backward-compatible staff guard.
12 *
13 * @deprecated Use Permission_Rules::verdict() for complete permission decisions.
14 */
15 class Customer_Account_Guard {
16 /**
17 * Get protected staff capabilities.
18 *
19 * @deprecated Use Permission_Rules::protected_capabilities().
20 * @return array
21 */
22 public static function protected_capabilities(): array {
23 return Permission_Rules::protected_capabilities();
24 }
25
26 /**
27 * Check whether an actor may modify a target.
28 *
29 * @deprecated Use Permission_Rules::can_modify().
30 * @param int $actor_id Acting user ID.
31 * @param int $target_id Target user ID.
32 * @return bool
33 */
34 public static function can_modify( int $actor_id, int $target_id ): bool {
35 return Permission_Rules::can_modify( $actor_id, $target_id );
36 }
37
38 /**
39 * Temporarily allow a cleared target role.
40 *
41 * @deprecated Use Permission_Rules::allow_target_roles().
42 * @param int $target_id Cleared target user ID.
43 * @return callable
44 */
45 public static function allow_target_roles( int $target_id ): callable {
46 return Permission_Rules::allow_target_roles( $target_id );
47 }
48
49 /**
50 * Build the staff account permission error.
51 *
52 * @deprecated Use Permission_Rules::denial().
53 * @return \WP_Error
54 */
55 public static function denial(): \WP_Error {
56 return Permission_Rules::denial();
57 }
58 }
59