Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class TemplatePolicy |
||
10 | { |
||
11 | use HandlesAuthorization; |
||
12 | |||
13 | /** |
||
14 | * Determine whether the user can view the template. |
||
15 | * |
||
16 | * @param \App\Models\User $user |
||
17 | * @param Template $template |
||
18 | * @return mixed |
||
19 | */ |
||
20 | public function view(User $user, Template $template) |
||
21 | { |
||
22 | return $user->id === $template->user_id; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Determine whether the user can update the template. |
||
27 | * |
||
28 | * @param \App\Models\User $user |
||
29 | * @param Template $template |
||
30 | * @return mixed |
||
31 | */ |
||
32 | public function update(User $user, Template $template) |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Determine whether the user can delete the template. |
||
39 | * |
||
40 | * @param \App\Models\User $user |
||
41 | * @param Template $template |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function delete(User $user, Template $template) |
||
47 | } |
||
48 | } |
||
49 |