public function recipientsAction(Request $request)
    {
        $taskType = $request->get('type');

        $types = $this->get('phlexible_task.types');
        $userManager = $this->get('phlexible_user.user_manager');
        $authorizationChecker = $this->get('security.authorization_checker');

        $type = $types->get($taskType);

        $users = [];
        foreach ($userManager->findAll() as $user) {
            if (!$authorizationChecker->isGranted('ROLE_TASKS')) {
                continue;
            }

            if ($type->getRole() && !$authorizationChecker->isGranted($type->getRole())) {
                continue;
            }

            $users[$user->getDisplayName()] = [
                'uid' => $user->getId(),
                'username' => $user->getDisplayName(),
            ];
        }

        ksort($users);
        $users = array_values($users);

        return new JsonResponse(['users' => $users]);
    }