コード例 #1
0
 public ActionResult PermisosParaRol(Guid id)
 {
     try
     {
         var rol      = _rolesRepository.ObtenerPorId(id);
         var acciones = _accionesRepository.ObtenerTodos();
         TempData["AccionesDisponibles"] =
             acciones.Where(x => !x.EsEtapa).OrderBy(x => x.Controlador.Nombre).ThenBy(x => x.NombreAmigable).ToList();
         var accioneEnRol = rol.PermisosRol.Where(a => a.Permitido).Select(a => a.Accion);
         TempData["AccionesEnRol"] = accioneEnRol.ToList();
         return(View(rol));
     }
     catch (Exception ex)
     {
         Utilidades.ColocarMensaje(ex.Message, ErrorType.Error, Request);
         return(RedirectToAction("Index", "Rol"));
     }
 }