'error', 'key' => 'project', 'method' => '', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_LIST', $token); $groups = $userQuery->getGroups($token); $body['method'] = 'list'; if (!empty($groups)) { $list = $projectQuery->list($groups, false); } else { $list = $projectQuery->list($groups); } if (is_array($list)) { $body['type'] = 'success'; $body['data'] = $list; $respond->statusOk(); } else { $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }