Total Complexity | 6 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class CustomerPolicy |
||
11 | { |
||
12 | use AllowTrait; |
||
13 | use HandlesAuthorization; |
||
14 | |||
15 | /* |
||
16 | * Manage customers determines if they can deactivate and recover customers |
||
17 | */ |
||
18 | public function manage(User $user) |
||
19 | { |
||
20 | return $this->checkPermission($user, 'Manage Customers'); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Determine whether the user can create new customers |
||
25 | */ |
||
26 | public function create(User $user) |
||
27 | { |
||
28 | return $this->checkPermission($user, 'Add Customer'); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Determine whether the user can update the customer |
||
33 | */ |
||
34 | public function update(User $user) |
||
35 | { |
||
36 | return $this->checkPermission($user, 'Update Customer'); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Determine whether the user can delete the customer |
||
41 | */ |
||
42 | public function delete(User $user) |
||
43 | { |
||
44 | return $this->checkPermission($user, 'Deactivate Customer'); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Determine whether the user can restore the customer |
||
49 | */ |
||
50 | public function restore(User $user) |
||
51 | { |
||
52 | return $this->checkPermission($user, 'Deactivate Customer'); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Determine whether the user can permanently delete the customer |
||
57 | */ |
||
58 | public function forceDelete(User $user) |
||
61 | } |
||
62 | } |
||
63 |