Commit b3e067eba56e024fe657c2aba7c37f2a7e215ce9
1 parent
1233af2902
Exists in
master
asignar role al asignarle una oferta al docente
Showing
1 changed file
with
5 additions
and
0 deletions
 
Show diff stats
src/AppBundle/Controller/SeccionController.php
| @@ -47,6 +47,11 @@ class SeccionController extends Controller | @@ -47,6 +47,11 @@ class SeccionController extends Controller | ||
| 47 | 47 | ||
| 48 | if ($form->isSubmitted() && $form->isValid()) { | 48 | if ($form->isSubmitted() && $form->isValid()) { | 
| 49 | $em = $this->getDoctrine()->getManager(); | 49 | $em = $this->getDoctrine()->getManager(); | 
| 50 | + | ||
| 51 | + $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | ||
| 52 | + $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_DOCENTE")); | ||
| 53 | + | ||
| 54 | + $em->persist($user); | ||
| 50 | $em->persist($seccion); | 55 | $em->persist($seccion); | 
| 51 | $em->flush(); | 56 | $em->flush(); | 
| 52 | 57 |