X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=Projects%2FControllers%2FProjectsController.cs;h=ab93cc85bce70c71f4743b01ca85b7a49f649323;hb=HEAD;hp=b6f57e603962ab524df4f0eeb5fcf27c5cfd70eb;hpb=5b4b7fb2dc8e07cdfe9a30c321191444d05fe24a;p=wsti_pai.git diff --git a/Projects/Controllers/ProjectsController.cs b/Projects/Controllers/ProjectsController.cs index b6f57e6..ab93cc8 100644 --- a/Projects/Controllers/ProjectsController.cs +++ b/Projects/Controllers/ProjectsController.cs @@ -36,6 +36,7 @@ namespace Projects.Models } // GET: Projects/Create + [Authorize(Roles = "admin")] public ActionResult Create() { ViewBag.user_id = new SelectList(db.Users, "id", "login"); @@ -45,6 +46,7 @@ namespace Projects.Models // POST: Projects/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [Authorize(Roles = "admin")] [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = "id,user_id,name,description")] Project project) @@ -63,6 +65,7 @@ namespace Projects.Models } // GET: Projects/Edit/5 + [Authorize(Roles = "admin")] public ActionResult Edit(int? id) { if (id == null) @@ -81,6 +84,7 @@ namespace Projects.Models // POST: Projects/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. + [Authorize(Roles = "admin")] [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit([Bind(Include = "id,user_id,name,description,created_at")] Project project) @@ -97,6 +101,7 @@ namespace Projects.Models } // GET: Projects/Delete/5 + [Authorize(Roles = "admin")] public ActionResult Delete(int? id) { if (id == null) @@ -112,6 +117,7 @@ namespace Projects.Models } // POST: Projects/Delete/5 + [Authorize(Roles = "admin")] [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] public ActionResult DeleteConfirmed(int id)