Created
August 8, 2012 13:33
-
-
Save jkuemerle/3295063 to your computer and use it in GitHub Desktop.
"Secure" Royalty Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Web.Mvc; | |
| namespace WebApplication.Controllers | |
| { | |
| public class RoyaltyController : Controller | |
| { | |
| public ActionResult Index() | |
| { | |
| return View(); | |
| } | |
| [Authorize(Roles="Admin")] | |
| public ActionResult Edit(string authorID, string titleID) | |
| { | |
| return View(WebApplication.Data.DataServices.GetRoyalty((DataAccess.Data)Session["pubs"],authorID, titleID)); | |
| } | |
| [HttpPost] | |
| [Authorize(Roles="Admin")] | |
| public ActionResult Edit(DataAccess.DTO.Royalty value) | |
| { | |
| return View(WebApplication.Data.DataServices.UpdateRoyalty((DataAccess.Data)Session["pubs"], value)); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment