public ActionResult Index() { var role = Auth.GetRole(); if (role != (int)Auth.Roles.LibraryUser && role != (int)Auth.Roles.LibraryWorker && role != (int)Auth.Roles.Publisher) { Auth.SetRole((int)Auth.Roles.NotLoggedIn); } return(View()); }
public ActionResult Index() { var offers = from o in db.Offers select o; if (Auth.GetRole() == (int)Auth.Roles.Publisher) { int id = Auth.GetUserId(); offers = offers.Where(o => o.PublisherId == id); } return(View(offers.ToList())); }