summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/DeveloperController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-06 17:39:37 -0400
committerMichael <[email protected]>2017-04-06 17:39:37 -0400
commite5ec0ad9c232b2613367de9461bca63bc2973787 (patch)
tree6c9742a9c85df8ec6e3b64a6a07cf9ca56314f80 /Project-Unite/Controllers/DeveloperController.cs
parent334980fc8a135efc7e95f6d3a1f0820d0a12f1d3 (diff)
downloadproject-unite-e5ec0ad9c232b2613367de9461bca63bc2973787.tar.gz
project-unite-e5ec0ad9c232b2613367de9461bca63bc2973787.tar.bz2
project-unite-e5ec0ad9c232b2613367de9461bca63bc2973787.zip
Modify dev CP
You can now change obsolescence and stability of releases.
Diffstat (limited to 'Project-Unite/Controllers/DeveloperController.cs')
-rw-r--r--Project-Unite/Controllers/DeveloperController.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/DeveloperController.cs b/Project-Unite/Controllers/DeveloperController.cs
index aed4eb5..9e2921b 100644
--- a/Project-Unite/Controllers/DeveloperController.cs
+++ b/Project-Unite/Controllers/DeveloperController.cs
@@ -21,6 +21,44 @@ namespace Project_Unite.Controllers
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()
{
if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))