1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Policies; |
4
|
|
|
|
5
|
|
|
use App\Models\Customer; |
6
|
|
|
use App\Models\User; |
7
|
|
|
use App\Traits\AllowTrait; |
8
|
|
|
use Illuminate\Auth\Access\HandlesAuthorization; |
9
|
|
|
|
10
|
|
|
class CustomerPolicy |
11
|
|
|
{ |
12
|
|
|
use HandlesAuthorization; |
13
|
|
|
use AllowTrait; |
|
|
|
|
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Determine whether the user can view any models. |
17
|
|
|
* |
18
|
|
|
* @param \App\Models\User $user |
19
|
20 |
|
* @return \Illuminate\Auth\Access\Response|bool |
20
|
|
|
*/ |
21
|
20 |
|
public function viewAny(User $user) |
|
|
|
|
22
|
|
|
{ |
23
|
|
|
// |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
5 |
|
* Determine whether the user can view the model. |
28
|
|
|
* |
29
|
5 |
|
* @param \App\Models\User $user |
30
|
|
|
* @param \App\Models\Customer $customer |
31
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
32
|
|
|
*/ |
33
|
|
|
public function view(User $user, Customer $customer) |
|
|
|
|
34
|
|
|
{ |
35
|
3 |
|
// |
36
|
|
|
} |
37
|
3 |
|
|
38
|
|
|
/** |
39
|
|
|
* Determine whether the user can create models. |
40
|
|
|
* |
41
|
|
|
* @param \App\Models\User $user |
42
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
43
|
3 |
|
*/ |
44
|
|
|
public function create(User $user) |
45
|
3 |
|
{ |
46
|
|
|
return $this->checkPermission($user, 'Add Customer'); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Determine whether the user can update the model. |
51
|
|
|
* |
52
|
|
|
* @param \App\Models\User $user |
53
|
|
|
* @param \App\Models\Customer $customer |
54
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
55
|
|
|
*/ |
56
|
|
|
public function update(User $user, Customer $customer) |
|
|
|
|
57
|
|
|
{ |
58
|
|
|
// |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Determine whether the user can delete the model. |
63
|
|
|
* |
64
|
|
|
* @param \App\Models\User $user |
65
|
|
|
* @param \App\Models\Customer $customer |
66
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
67
|
|
|
*/ |
68
|
|
|
public function delete(User $user, Customer $customer) |
|
|
|
|
69
|
|
|
{ |
70
|
|
|
// |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Determine whether the user can restore the model. |
75
|
|
|
* |
76
|
|
|
* @param \App\Models\User $user |
77
|
|
|
* @param \App\Models\Customer $customer |
78
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
79
|
|
|
*/ |
80
|
|
|
public function restore(User $user, Customer $customer) |
|
|
|
|
81
|
|
|
{ |
82
|
|
|
// |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Determine whether the user can permanently delete the model. |
87
|
|
|
* |
88
|
|
|
* @param \App\Models\User $user |
89
|
|
|
* @param \App\Models\Customer $customer |
90
|
|
|
* @return \Illuminate\Auth\Access\Response|bool |
91
|
|
|
*/ |
92
|
|
|
public function forceDelete(User $user, Customer $customer) |
|
|
|
|
93
|
|
|
{ |
94
|
|
|
// |
95
|
|
|
} |
96
|
|
|
} |
97
|
|
|
|