comparison Agendas/trunk/src/Agendas.Web/Controllers/PatrocinadorApiController.cs @ 292:1408ac17cb64

Patrocinadores: Faltaba aplicar seguridad a la Api de Patrocinadores.
author juanjose.montesdeocaarbos
date Thu, 09 Feb 2012 08:40:38 -0300
parents c8f378272407
children 9bc60d166c8a
comparison
equal deleted inserted replaced
291:5f1e3d35e113 292:1408ac17cb64
1 using System; 1 using System.Web;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.Mvc; 2 using System.Web.Mvc;
6 using System.IO; 3 using System.IO;
7 using AltNetHispano.Agendas.Domain; 4 using AltNetHispano.Agendas.Domain;
8 using AltNetHispano.Agendas.Factories; 5 using AltNetHispano.Agendas.Factories;
9 using AltNetHispano.Agendas.Web.Models; 6 using AltNetHispano.Agendas.Web.Models;
34 public PatrocinadorApiController(HttpServerUtilityBase server) 31 public PatrocinadorApiController(HttpServerUtilityBase server)
35 { 32 {
36 _server = server; 33 _server = server;
37 } 34 }
38 35
39 //[CustomAuthorize(Roles = Roles.Administrador)] 36 [CustomAuthorize(Roles = Roles.Administrador)]
40 public PartialViewResult Nuevo() 37 public PartialViewResult Nuevo()
41 { 38 {
42 var model = new PatrocinadorNewModel(); 39 var model = new PatrocinadorNewModel();
43 return PartialView(model); 40 return PartialView(model);
44 } 41 }
45 42
46 [HttpPost] 43 [HttpPost]
47 //[CustomAuthorize(Roles = Roles.Administrador)] 44 [CustomAuthorize(Roles = Roles.Administrador)]
48 public JsonResult Nuevo(PatrocinadorNewModel model) 45 public JsonResult Nuevo(PatrocinadorNewModel model)
49 { 46 {
50 if (ModelState.IsValid) 47 if (ModelState.IsValid)
51 { 48 {
52 var patrocinadores = AgendaFactory.GetPatrocinadorRepository(); 49 var patrocinadores = AgendaFactory.GetPatrocinadorRepository();