| Total Complexity | 6 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class FileStorageAccess |
||
| 8 | { |
||
| 9 | public function handle($request, \Closure $next) |
||
| 10 | { |
||
| 11 | foreach (Integration\Joints\FileStorageAccessJoint::collect() as $joint) { |
||
| 12 | if ($joint->accessGranted($request)) { |
||
| 13 | $this->logFileAccess($request->get('id'), $request->get('action', 'download')); |
||
| 14 | |||
| 15 | return $next($request); |
||
| 16 | } |
||
| 17 | } |
||
| 18 | |||
| 19 | return response('No access to file', 401); |
||
| 20 | } |
||
| 21 | |||
| 22 | protected function logFileAccess($fileId, $action, $time = null) |
||
| 33 | ]); |
||
| 34 | } |
||
| 36 |