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