diff Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs @ 179:1deccd6c3cb2

Aplicando seguridad x roles en sitio web
author nelopauselli
date Mon, 08 Aug 2011 15:24:26 -0300
parents 784d81e32366
children beeb48ddb44a
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs	Mon Aug 08 12:30:37 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/EventoController.cs	Mon Aug 08 15:24:26 2011 -0300
@@ -36,7 +36,7 @@
 			return View(model);
 		}
 
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Nuevo()
 		{
 		    var model = new EventoNewModel {Fecha = DateTime.Now};
@@ -44,7 +44,7 @@
 		}
 
 		[HttpPost]
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Nuevo(EventoNewModel model)
 		{
 			if (ModelState.IsValid)
@@ -63,7 +63,7 @@
             return View("Defaulteditor", model);
 		}
 
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Confirmar(string id)
 		{
 			var agenda = AgendaFactory.GetAgenda();
@@ -77,7 +77,7 @@
 			return RedirectToAction("Index");
 		}
 
-    	[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Publicar(string id)
 		{
 			var agenda = AgendaFactory.GetAgenda();
@@ -95,7 +95,7 @@
 		}
 
 		[HttpPost]
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Publicar(EventoPublicarModel model)
 		{
 			if (ModelState.IsValid)
@@ -113,7 +113,7 @@
 			return View("Defaulteditor", model);
 		}
 
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Modificar(string id)
 		{
 			var agenda = AgendaFactory.GetAgenda();
@@ -131,7 +131,7 @@
 		}
 		
 		[HttpPost]
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Modificar(EventoEditModel model)
 		{
 			if (ModelState.IsValid)
@@ -149,7 +149,7 @@
             return View("Defaulteditor", model);
 		}
 
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Agendar(string id)
 		{
 			var agenda = AgendaFactory.GetAgenda();
@@ -167,7 +167,7 @@
 		}
 
 		[HttpPost]
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Agendar(EventoAgendarModel model)
 		{
 			if (ModelState.IsValid)
@@ -185,7 +185,7 @@
             return View("Defaulteditor", model);
 		}
 
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Proponer()
 		{
 			throw new NotImplementedException();
@@ -194,7 +194,7 @@
 		}
 
 		[HttpPost]
-		[Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 		public ActionResult Proponer(PropuestaNewModel model)
 		{
 			throw new NotImplementedException();
@@ -212,8 +212,8 @@
 			}
             return View("Defaulteditor", model);
 		}
-        
-        [Authorize]
+
+		[CustomAuthorize(Roles = Roles.Administrador)]
 	    public ActionResult Cancelar(string id)
 	    {
             var agenda = AgendaFactory.GetAgenda();
@@ -223,7 +223,7 @@
             return RedirectToAction("Index");
 	    }
 
-        [Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 	    public ActionResult Descartar(string id)
 	    {
             var agenda = AgendaFactory.GetAgenda();
@@ -233,7 +233,7 @@
             return RedirectToAction("Index");
 	    }
 
-        [Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 	    public ActionResult ReAgendar(string id)
 	    {
             var agenda = AgendaFactory.GetAgenda();
@@ -243,7 +243,7 @@
             return RedirectToAction("Index");
 	    }
 
-        [Authorize]
+		[CustomAuthorize(Roles = Roles.Administrador)]
 	    public ActionResult ReProponer(string id)
 	    {
             var agenda = AgendaFactory.GetAgenda();