src/Phlexible/Bundle/DashboardBundle/Controller/PortletController.php
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);
    }
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);
    }
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 ) ; }
Return portlets.

@return JsonResponse
@Route("", name="dashboard_portlets")
@Method("GET")
@ApiDoc(
description="Returns a list of user portlets"
)
Return portlets .