From b3e067eba56e024fe657c2aba7c37f2a7e215ce9 Mon Sep 17 00:00:00 2001 From: Wilmer Ramones Date: Mon, 25 Jul 2016 15:03:26 -0400 Subject: [PATCH] asignar role al asignarle una oferta al docente --- src/AppBundle/Controller/SeccionController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AppBundle/Controller/SeccionController.php b/src/AppBundle/Controller/SeccionController.php index 12089ce..7de7b5d 100644 --- a/src/AppBundle/Controller/SeccionController.php +++ b/src/AppBundle/Controller/SeccionController.php @@ -47,6 +47,11 @@ class SeccionController extends Controller if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); + + $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); + $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_DOCENTE")); + + $em->persist($user); $em->persist($seccion); $em->flush(); -- 2.0.0