summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/DeveloperController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-09 16:00:37 -0400
committerMichael <[email protected]>2017-05-09 16:00:37 -0400
commitc84f6193547370d6786609404e6dbc51f181d7b0 (patch)
treeb3b9cad1beadddbfe2de9f736424638275691c91 /Project-Unite/Controllers/DeveloperController.cs
parentcb653f021d2567f69a63414963b0f5ef739cd641 (diff)
downloadproject-unite-c84f6193547370d6786609404e6dbc51f181d7b0.tar.gz
project-unite-c84f6193547370d6786609404e6dbc51f181d7b0.tar.bz2
project-unite-c84f6193547370d6786609404e6dbc51f181d7b0.zip
Redo the permission system.
Diffstat (limited to 'Project-Unite/Controllers/DeveloperController.cs')
-rw-r--r--Project-Unite/Controllers/DeveloperController.cs29
1 files changed, 1 insertions, 28 deletions
diff --git a/Project-Unite/Controllers/DeveloperController.cs b/Project-Unite/Controllers/DeveloperController.cs
index da0022e..cbe1436 100644
--- a/Project-Unite/Controllers/DeveloperController.cs
+++ b/Project-Unite/Controllers/DeveloperController.cs
@@ -9,23 +9,19 @@ using Project_Unite.Models;
namespace Project_Unite.Controllers
{
+ [RequiresDeveloper]
[Authorize]
public class DeveloperController : Controller
{
// GET: Developer
public ActionResult Index()
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
ViewBag.Developer = true;
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;
@@ -35,9 +31,6 @@ namespace Project_Unite.Controllers
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;
@@ -48,9 +41,6 @@ namespace Project_Unite.Controllers
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;
@@ -61,18 +51,12 @@ namespace Project_Unite.Controllers
public ActionResult Releases()
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
var db = new ApplicationDbContext();
return View(db.Downloads);
}
public ActionResult AddRelease()
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
- if (!ACL.Granted(User.Identity.Name, "CanReleaseBuild"))
- return new HttpStatusCodeResult(403);
ViewBag.Developer = true;
var build = new PostDownloadViewModel();
@@ -85,10 +69,6 @@ namespace Project_Unite.Controllers
[ValidateAntiForgeryToken]
public ActionResult AddRelease(PostDownloadViewModel model)
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
- if (!ACL.Granted(User.Identity.Name, "CanReleaseBuild"))
- return new HttpStatusCodeResult(403);
if (!ModelState.IsValid)
return View(model);
@@ -174,8 +154,6 @@ namespace Project_Unite.Controllers
[Authorize]
public ActionResult Wiki()
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
ViewBag.Developer = true;
var db = new ApplicationDbContext();
var cats = db.WikiCategories;
@@ -184,9 +162,6 @@ namespace Project_Unite.Controllers
public ActionResult AddWikiCategory()
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
-
ViewBag.Developer = true;
var mdl = new AddWikiCategoryViewModel();
@@ -198,8 +173,6 @@ namespace Project_Unite.Controllers
[ValidateAntiForgeryToken]
public ActionResult AddWikiCategory(AddWikiCategoryViewModel model)
{
- if (!ACL.Granted(User.Identity.Name, "CanAccessDevCP"))
- return new HttpStatusCodeResult(403);
ViewBag.Developer = true;
if (!ModelState.IsValid)
return View(model);