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