public function listAction()
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $groups = [];
        foreach ($groupManager->findAll() as $group) {
            $members = [];
            foreach ($group->getUsers() as $user) {
                $members[] = $user->getDisplayName();
            }
            sort($members);

            $groups[] = [
                'gid' => $group->getId(),
                'name' => $group->getName(),
                'readonly' => false,
                'memberCnt' => count($members),
                'members' => $members,
            ];
        }

        return new JsonResponse($groups);
    }