Select Git revision
-
Bekerle, Patrizio authoredBekerle, Patrizio authored
LoggedInOnly.php 541 B
<?php
declare(strict_types=1);
namespace Dbp\Relay\ExampleBundle\Controller;
use Dbp\Relay\ExampleBundle\Entity\Place;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
/**
* This is an example controller that only allows logged-in users to access it.
*/
class LoggedInOnly extends AbstractController
{
public function __invoke(Place $data, Request $request): Place
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
return $data;
}
}