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

Aplicando seguridad x roles en sitio web
author nelopauselli
date Mon, 08 Aug 2011 15:24:26 -0300
parents f17252543cbf
children 222362c29416
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/PersonaController.cs	Mon Aug 08 12:30:37 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/PersonaController.cs	Mon Aug 08 15:24:26 2011 -0300
@@ -1,6 +1,7 @@
 using System;
 using System.Linq;
 using System.Web.Mvc;
+using AltNetHispano.Agendas.Domain;
 using AltNetHispano.Agendas.Factories;
 using AltNetHispano.Agendas.Web.Models;
 
@@ -17,13 +18,15 @@
             return View(model);
         }
 
-        public ActionResult Nueva()
+		[CustomAuthorize(Roles = Roles.Administrador)]
+		public ActionResult Nueva()
         {
             var model = new PersonaNewModel();
             return View("Defaulteditor", model);
         }
 
         [HttpPost]
+		[CustomAuthorize(Roles = Roles.Administrador)]
         public ActionResult Nueva(PersonaNewModel model)
         {
             if (ModelState.IsValid)
@@ -41,7 +44,8 @@
             return View("Defaulteditor", model);
         }
 
-        public ActionResult Modificar(string id)
+		[CustomAuthorize(Roles = Roles.Administrador)]
+		public ActionResult Modificar(string id)
         {
             var personas = AgendaFactory.GetPersonaService();
 
@@ -65,7 +69,8 @@
         }
 
         [HttpPost]
-        public ActionResult Modificar(PersonaEditModel model)
+		[CustomAuthorize(Roles = Roles.Administrador)]
+		public ActionResult Modificar(PersonaEditModel model)
         {
             if (ModelState.IsValid)
             {