mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-02-02 13:07:34 +00:00
Modify dev CP
You can now change obsolescence and stability of releases.
This commit is contained in:
parent
334980fc8a
commit
e5ec0ad9c2
1 changed files with 38 additions and 0 deletions
|
@ -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"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue