public function portletsAction()
    {
        $securityContext = $this->get('security.context');

        $data = [];
        foreach ($this->get('phlexible_dashboard.portlets')->all() as $portlet) {
            if ($portlet->hasRole() && !$securityContext->isGranted($portlet->getRole())) {
                continue;
            }

            $data[] = $portlet->toArray();
        }

        return new JsonResponse($data);
    }