From: Raphaƫl Gertz <git@rapsys.eu>
Date: Thu, 14 Nov 2024 06:34:37 +0000 (+0100)
Subject: Replace hardcoded role by configurable key
X-Git-Tag: 0.5.5~1
X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/5a98a00e7d88a4ab0e68d68abf1eee8842cb1b30

Replace hardcoded role by configurable key
---

diff --git a/Controller/UserController.php b/Controller/UserController.php
index 672f933..22ce0f8 100644
--- a/Controller/UserController.php
+++ b/Controller/UserController.php
@@ -155,7 +155,7 @@ class UserController extends AbstractController {
 			//Set civility default
 			'civility_default' => $this->doctrine->getRepository($this->config['class']['civility'])->findOneByTitle($this->config['default']['civility']),
 			//Disable mail
-			'mail' => $this->checker->isGranted('ROLE_ADMIN'),
+			'mail' => $this->checker->isGranted('ROLE_'.strtoupper($this->config['default']['admin'])),
 			//Disable password
 			'password' => false,
 			//Set method