Modify dev CP

You can now change obsolescence and stability of releases.
This commit is contained in:
Michael 2017-04-06 17:39:37 -04:00
parent 334980fc8a
commit e5ec0ad9c2

View file

@ -21,6 +21,44 @@ namespace Project_Unite.Controllers
return View(); return View();
} }
public ActionResult ToggleObsolete(string id)
{
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
return new HttpStatusCodeResult(403);
var db = new ApplicationDbContext();
var release = db.Downloads.FirstOrDefault(x => x.Id == id);
release.Obsolete = !release.Obsolete;
db.SaveChanges();
return RedirectToAction("Releases");
}
public ActionResult MakeUnstable(string id)
{
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
return new HttpStatusCodeResult(403);
var db = new ApplicationDbContext();
var release = db.Downloads.FirstOrDefault(x => x.Id == id);
release.IsStable = false;
db.SaveChanges();
return RedirectToAction("Releases");
}
public ActionResult MakeStable(string id)
{
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
return new HttpStatusCodeResult(403);
var db = new ApplicationDbContext();
var release = db.Downloads.FirstOrDefault(x => x.Id == id);
release.IsStable = true;
db.SaveChanges();
return RedirectToAction("Releases");
}
public ActionResult Releases() public ActionResult Releases()
{ {
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP")) if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))