Commit 796a21cc by Mathieu Poisbeau

#232: give to ROLE_TRESORIER the ability to modify the quantity of non-pledged…

#232: give to ROLE_TRESORIER the ability to modify the quantity of non-pledged banknotes (as for ROLE_ADMIN_SIEGE)
parent 48c619c7
...@@ -117,7 +117,7 @@ class UserSiegeController extends FluxController ...@@ -117,7 +117,7 @@ class UserSiegeController extends FluxController
/** /**
* @Route("/solde/siege/", name="soldeSiege") * @Route("/solde/siege/", name="soldeSiege")
* @Security("is_granted('ROLE_ADMIN_SIEGE') or is_granted('ROLE_SUPER_ADMIN')") * @Security("is_granted('ROLE_ADMIN_SIEGE') or is_granted('ROLE_TRESORIER') or is_granted('ROLE_SUPER_ADMIN')")
*/ */
public function soldeSiegeAction(Request $request) public function soldeSiegeAction(Request $request)
{ {
......
...@@ -246,11 +246,11 @@ class FormFactory ...@@ -246,11 +246,11 @@ class FormFactory
if (empty($user) || empty($this->session->get('_comptoirgere')) || !($type == 'adherent' || $type == 'groupe' || $type == 'prestataire')) { if (empty($user) || empty($this->session->get('_comptoirgere')) || !($type == 'adherent' || $type == 'groupe' || $type == 'prestataire')) {
throw new \Exception("[FORM 12] Opération impossible !"); throw new \Exception("[FORM 12] Opération impossible !");
} }
$class = "App\Entity\RetraitComptoir".ucwords($type); $class = "App\Entity\RetraitComptoir" . ucwords($type);
$entity = new $class(); $entity = new $class();
$entity->setOperateur($user); $entity->setOperateur($user);
$entity->setExpediteur($this->session->get('_comptoirgere')); $entity->setExpediteur($this->session->get('_comptoirgere'));
$form = $this->ff->create('App\Form\Type\RetraitComptoir'.ucwords($type).'FormType', $entity, array('action' => $this->router->generate('retraitComptoir'.ucwords($type)))); $form = $this->ff->create('App\Form\Type\RetraitComptoir' . ucwords($type) . 'FormType', $entity, array('action' => $this->router->generate('retraitComptoir' . ucwords($type))));
return $form->createView(); return $form->createView();
} }
...@@ -261,11 +261,11 @@ class FormFactory ...@@ -261,11 +261,11 @@ class FormFactory
if (empty($user) || empty($this->session->get('_comptoirgere')) || !($type == 'adherent' || $type == 'groupe' || $type == 'prestataire')) { if (empty($user) || empty($this->session->get('_comptoirgere')) || !($type == 'adherent' || $type == 'groupe' || $type == 'prestataire')) {
throw new \Exception("[FORM 12] Opération impossible !"); throw new \Exception("[FORM 12] Opération impossible !");
} }
$class = "App\Entity\VenteComptoir".ucwords($type); $class = "App\Entity\VenteComptoir" . ucwords($type);
$entity = new $class(); $entity = new $class();
$entity->setOperateur($user); $entity->setOperateur($user);
$entity->setExpediteur($this->session->get('_comptoirgere')); $entity->setExpediteur($this->session->get('_comptoirgere'));
$form = $this->ff->create('App\Form\Type\VenteComptoir'.ucwords($type).'FormType', $entity, array('action' => $this->router->generate('venteComptoir'.ucwords($type)))); $form = $this->ff->create('App\Form\Type\VenteComptoir' . ucwords($type) . 'FormType', $entity, array('action' => $this->router->generate('venteComptoir' . ucwords($type))));
return $form->createView(); return $form->createView();
} }
...@@ -322,7 +322,7 @@ class FormFactory ...@@ -322,7 +322,7 @@ class FormFactory
public function getSoldeSiegeForm(User $user) public function getSoldeSiegeForm(User $user)
{ {
if (empty($user) || !$user->hasRole('ROLE_ADMIN_SIEGE')) { if (empty($user) || false === ($user->hasRole('ROLE_ADMIN_SIEGE') || $user->hasRole('ROLE_TRESORIER'))) {
throw new \Exception("[FORM 16] Opération impossible !"); throw new \Exception("[FORM 16] Opération impossible !");
} }
$siege = $this->em->getRepository(Siege::class)->findOneById(1); $siege = $this->em->getRepository(Siege::class)->findOneById(1);
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
{% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %} {% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %}
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %} {% include 'block/userpassword.html.twig' %}
{# {% include 'block/soldegroupes.html.twig' %} #} {% include 'siege/block/solde_edit.html.twig' %}
{% elseif app.user and is_granted('ROLE_CONTROLEUR') %} {% elseif app.user and is_granted('ROLE_CONTROLEUR') %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment