Skip to content

Commit 668491e

Browse files
committed
secure config page to admins only
1 parent 94a5d85 commit 668491e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Controller/ConfigurationController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ public function __construct(EntityManagerInterface $em, UrlGeneratorInterface $r
3131
#[Route('/configuration', name: 'app_configuration')]
3232
public function index(Request $request): Response
3333
{
34+
if (!$this->getUser() || !$this->isGranted('IS_AUTHENTICATED')) {
35+
return $this->redirectToRoute('app_login');
36+
}
37+
38+
$this->denyAccessUnlessGranted('ROLE_ADMIN');
39+
3440
$repository = $this->em->getRepository(Config::class);
3541
$entries = $repository->findAll();
3642

0 commit comments

Comments
 (0)