| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class UserPolicy extends BasePolicy |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Determine whether the user can view the target user. |
||
| 13 | * |
||
| 14 | * @param \App\Models\User $user |
||
|
2 ignored issues
–
show
|
|||
| 15 | * @param \App\Models\User $targetUser |
||
|
2 ignored issues
–
show
|
|||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | public function view(User $user, User $targetUser) |
||
| 19 | { |
||
| 20 | return $user->id === $targetUser->id; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Determine whether the user can create courses. |
||
| 25 | * |
||
| 26 | * @param \App\Models\User $user |
||
|
2 ignored issues
–
show
|
|||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function create(User $user) |
||
| 30 | { |
||
| 31 | return false; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Determine whether the user can update the target user. |
||
| 36 | * |
||
| 37 | * @param \App\Models\User $user |
||
|
2 ignored issues
–
show
|
|||
| 38 | * @param \App\Models\User $targetUser |
||
|
2 ignored issues
–
show
|
|||
| 39 | * @return mixed |
||
| 40 | */ |
||
| 41 | public function update(User $user, User $targetUser) |
||
| 42 | { |
||
| 43 | return $user->id === $targetUser->id; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Determine whether the user can delete the target user. |
||
| 48 | * |
||
| 49 | * @param \App\Models\User $user |
||
|
2 ignored issues
–
show
|
|||
| 50 | * @param \App\Models\User $targetUser |
||
|
2 ignored issues
–
show
|
|||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | public function delete(User $user, User $targetUser) |
||
| 56 | } |
||
| 57 | } |
||
| 58 |