Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
19 / 19 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Roles | |
100.00% |
19 / 19 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
19 / 19 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsadmin; |
| 4 | |
| 5 | use BO\Zmsentities\Exception\UserAccountMissingRights; |
| 6 | use Psr\Http\Message\RequestInterface; |
| 7 | use Psr\Http\Message\ResponseInterface; |
| 8 | |
| 9 | class Roles extends BaseController |
| 10 | { |
| 11 | /** |
| 12 | * @SuppressWarnings(Param) |
| 13 | */ |
| 14 | public function readResponse( |
| 15 | RequestInterface $request, |
| 16 | ResponseInterface $response, |
| 17 | array $args |
| 18 | ) { |
| 19 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity(); |
| 20 | if (!$workstation->getUseraccount()->hasPermissions(['superuser'])) { |
| 21 | throw new UserAccountMissingRights(); |
| 22 | } |
| 23 | |
| 24 | $validator = $request->getAttribute('validator'); |
| 25 | $success = $validator->getParameter('success')->isString()->getValue(); |
| 26 | $error = $validator->getParameter('error')->isString()->getValue(); |
| 27 | |
| 28 | $roleList = \App::$http->readGetResult('/roles/', [])->getCollection(); |
| 29 | |
| 30 | return \BO\Slim\Render::withHtml( |
| 31 | $response, |
| 32 | 'page/rolesList.twig', |
| 33 | [ |
| 34 | 'title' => 'Rollen', |
| 35 | 'menuActive' => 'roles', |
| 36 | 'workstation' => $workstation, |
| 37 | 'roleList' => $roleList, |
| 38 | 'success' => $success, |
| 39 | 'error' => $error, |
| 40 | ] |
| 41 | ); |
| 42 | } |
| 43 | } |