for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* This file is part of the mailserver-admin package.
* (c) Jeffrey Boehm <https://github.com/jeboehm/mailserver-admin>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface;
use Twig\Environment;
class AccessDeniedHandler implements AccessDeniedHandlerInterface
{
private Environment $twig;
public function __construct(Environment $twig)
$this->twig = $twig;
}
public function handle(Request $request, AccessDeniedException $accessDeniedException): Response
return new Response($this->twig->render('admin/access_denied.html.twig'));