getRouteParam('id'); if (!$userId) { throw new BadRequest(); } if ( !$this->user->isAdmin() && $this->user->getId() !== $userId ) { throw new Forbidden(); } $user = $this->entityManager->getEntityById(User::ENTITY_TYPE, $userId); if (!$user) { throw new NotFound(); } $data = $this->aclManager->getMapData($user); return ResponseComposer::json($data); } }