| 1 | <?php |
||
| 8 | class UserPolicy |
||
| 9 | { |
||
| 10 | use HandlesAuthorization; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * The before method will be executed before any other methods on the policy, |
||
| 14 | * giving you an opportunity to authorize the action before the intended |
||
| 15 | * policy method is actually called. This feature is most commonly used for |
||
| 16 | * authorizing application administrators to perform any action. |
||
| 17 | */ |
||
| 18 | public function before($user, $ability) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Determine whether the user can view the user. |
||
| 28 | * |
||
| 29 | * @param \App\User $user |
||
| 30 | * @param \App\User $user |
||
| 31 | * @return mixed |
||
| 32 | */ |
||
| 33 | public function view(User $user, User $user) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Determine whether the user can create users. |
||
| 41 | * |
||
| 42 | * @param \App\User $user |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | public function create(User $user) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Determine whether the user can update the user. |
||
| 53 | * |
||
| 54 | * @param \App\User $user |
||
| 55 | * @param \App\User $user |
||
| 56 | * @return mixed |
||
| 57 | */ |
||
| 58 | public function update(User $user, User $user) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Determine whether the user can delete the user. |
||
| 67 | * |
||
| 68 | * @param \App\User $user |
||
| 69 | * @param \App\User $user |
||
| 70 | * @return mixed |
||
| 71 | */ |
||
| 72 | public function delete(User $user, User $user) |
||
| 77 | } |
||
| 78 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.