Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
30 | { |
||
31 | if ($this->permission === null) { |
||
32 | throw new \InvalidArgumentException('Permission not set.'); |
||
33 | } |
||
34 | |||
35 | if (!$this->userService->hasPermission($this->permission)) { |
||
36 | return $this->responseFactory->createResponse(Status::FORBIDDEN); |
||
37 | } |
||
38 | |||
39 | return $handler->handle($request); |
||
40 | } |
||
49 |