1 | <?php |
||
11 | class AclMiddleware |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * The Guard implementation. |
||
16 | * |
||
17 | * @var Guard |
||
18 | */ |
||
19 | protected $auth; |
||
20 | |||
21 | /** |
||
22 | * The Acl implementation. |
||
23 | * |
||
24 | * @var Acl |
||
25 | */ |
||
26 | protected $acl; |
||
27 | |||
28 | /** |
||
29 | * The Config implementation. |
||
30 | * |
||
31 | * @var Config |
||
32 | */ |
||
33 | protected $config; |
||
34 | |||
35 | /** |
||
36 | * Create a new filter instance. |
||
37 | * |
||
38 | * @param Guard $auth |
||
39 | */ |
||
40 | 7 | public function __construct(Guard $auth, Acl $acl, Config $config) |
|
46 | |||
47 | /** |
||
48 | * Run the request filter. |
||
49 | * |
||
50 | * @param \Illuminate\Http\Request $request |
||
51 | * @param \Closure $next |
||
52 | * @return mixed |
||
53 | */ |
||
54 | 7 | public function handle(Request $request, Closure $next, $resource = null, $permission = null) |
|
66 | |||
67 | /** |
||
68 | * Processes not allowed response |
||
69 | * |
||
70 | * @param Request $request |
||
71 | * |
||
72 | * @return \Illuminate\Http\Response |
||
73 | */ |
||
74 | 5 | protected function notAllowed(Request $request) |
|
93 | } |
||
94 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.