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 | 47 | |
| 48 | 48 | if ($form->isSubmitted() && $form->isValid()) { | 
| 49 | 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 | 55 | $em->persist($seccion); | 
| 51 | 56 | $em->flush(); | 
| 52 | 57 | ... | ... |