Edition du devis fonctionnelle

This commit is contained in:
Paul Schneider 2014-10-20 07:23:44 +02:00
commit 2ac2338939
22 changed files with 347 additions and 74 deletions

View file

@ -21,9 +21,10 @@ namespace Yavsc.Controllers
public class FrontOfficeController : Controller
{
[Authorize]
public ActionResult Estimate(Estimate model,string submit)
public ActionResult Estimate(Estimate model,string submit)
{
if (ModelState.IsValid) {
ViewData ["WebApiUrl"] = "http://"+ Request.Url.Authority + "/api/WorkFlow";
string username = HttpContext.User.Identity.Name;
if (model.Id > 0) {
Estimate f = WorkFlowManager.GetEstimate (model.Id);
@ -31,7 +32,6 @@ namespace Yavsc.Controllers
ModelState.AddModelError ("Id", "Wrong Id");
return View (model);
}
if (username != f.Owner)
if (!Roles.IsUserInRole ("FrontOffice"))
throw new UnauthorizedAccessException ("You're not allowed to view/modify this estimate");