diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index a20ed7e0..2497836f 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -715,10 +715,11 @@ class GroupController extends Controller $em = $this->getDoctrine()->getManager(); // Permission - $permgroup=$this->get('session')->get('permgroup'); if($access=="user") { + $permgroup=$this->get('session')->get('permgroup'); if($permgroup=="NO_BODY") throw $this->createNotFoundException('Permission denied'); if($permgroup=="ROLE_ANIM" && $this->isGranted('ROLE_USER')) throw $this->createNotFoundException('Permission denied'); + if($permgroup=="ROLE_MODO" && ($this->isGranted('ROLE_ANIM') || $this->isGranted('ROLE_USER'))) throw $this->createNotFoundException('Permission denied'); } // Initialisation de l'enregistrement diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php index af26b137..b811677b 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php @@ -40,6 +40,14 @@ class UserController extends Controller public function listAction($access) { + // Permission + if($access=="user") { + $permannu=$this->get('session')->get('permannu'); + if($permannu=="NO_BODY") throw $this->createNotFoundException('Permission denied'); + if($permannu=="ROLE_ANIM" && $this->isGranted('ROLE_USER')) throw $this->createNotFoundException('Permission denied'); + if($permannu=="ROLE_MODO" && ($this->isGranted('ROLE_ANIM') || $this->isGranted('ROLE_USER'))) throw $this->createNotFoundException('Permission denied'); + } + $em = $this->getDoctrine()->getManager(); $config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers"); $fields=$config->getValue(); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/ConfigType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/ConfigType.php index d81c713b..925756cd 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/ConfigType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/ConfigType.php @@ -156,6 +156,7 @@ class ConfigType extends AbstractType "NO_BODY" => "NO_BODY", "ROLE_USER" => "ROLE_USER", "ROLE_ANIM" => "ROLE_ANIM", + "ROLE_MODO" => "ROLE_MODO", ); $builder->add("value", ChoiceType::class, diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig index 597d3bd7..73c862af 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig @@ -10,7 +10,7 @@ {% set permgroup = app.session.get('permgroup') %} - {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_USER" or permgroup=="ROLE_ANIM")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %} + {% if is_granted('ROLE_ADMIN') or (is_granted('ROLE_MODO') and (permgroup=="ROLE_MODO" or permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ANIM" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}
{% if access=="config" %}
Ajouter
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/menu.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/menu.html.twig
index 47dcf2e4..9d84cf3c 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/menu.html.twig
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Include/menu.html.twig
@@ -2,7 +2,12 @@
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') %}