Skip to content

Instantly share code, notes, and snippets.

@jkuemerle
Created August 8, 2012 13:33
Show Gist options
  • Select an option

  • Save jkuemerle/3295063 to your computer and use it in GitHub Desktop.

Select an option

Save jkuemerle/3295063 to your computer and use it in GitHub Desktop.
"Secure" Royalty Controller
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