| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 9 | protected function run( |
|
| 31 | ServerRequestInterface $request, |
||
| 32 | JsonEnabledResponseInterface $response, |
||
| 33 | array $args |
||
| 34 | ): ResponseInterface { |
||
| 35 | 9 | $user = $request->getAttribute(SessionValidatorMiddleware::USER); |
|
| 36 | 9 | if (!$this->privilegeChecker->isAdmin($user)) { |
|
| 37 | 1 | throw new AccessViolation(); |
|
| 38 | } |
||
| 39 | |||
| 40 | 8 | return $this->serve($request, $response, $args); |
|
| 41 | } |
||
| 52 |