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