1 | <?php |
||
9 | class Authorize |
||
10 | { |
||
11 | /** |
||
12 | * Handle an incoming request. |
||
13 | * |
||
14 | * @param \Illuminate\Http\Request $request |
||
15 | * @param \Closure $next |
||
16 | * @param string|null $ability |
||
17 | * @param string|null $boundModelName |
||
18 | * |
||
19 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException |
||
20 | * |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function handle($request, Closure $next, $ability = null, $boundModelName = null) |
||
33 | |||
34 | /** |
||
35 | * Get the model from the request using given boundModelName. |
||
36 | * |
||
37 | * @param mixed $request |
||
38 | * @param string $boundModelName |
||
39 | * |
||
40 | * @return \Illuminate\Database\Eloquent\Model|null |
||
41 | */ |
||
42 | protected function getModelFromRequest($request, $boundModelName) |
||
50 | |||
51 | /** |
||
52 | * Determine if the currently logged in use has the given ability. |
||
53 | * |
||
54 | * @param $user |
||
55 | * @param string|null $ability |
||
56 | * @param \Illuminate\Database\Eloquent\Model|null $model |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | protected function hasRequiredAbility($user, $ability = null, $model = null) |
||
80 | |||
81 | /** |
||
82 | * Handle the unauthorized request. |
||
83 | * |
||
84 | * @param $request |
||
85 | * @param string|null $ability |
||
86 | * @param \Illuminate\Database\Eloquent\Model|null $model |
||
87 | * |
||
88 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException |
||
89 | * |
||
90 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\RedirectResponse|Response |
||
91 | */ |
||
92 | protected function handleUnauthorizedRequest($request, $ability = null, $model = null) |
||
104 | } |
||
105 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.