Custom logging
[wsti_pai.git] / Projects / Controllers / ProjectTasksController.cs
index 81cb093977cc6bce6d1207d6a71ce35f6061bdd7..e28a4e57f4dbc92691a15f4b8be5bc63c87c213c 100644 (file)
@@ -37,6 +37,7 @@ namespace Projects.Controllers
         }
 
         // GET: ProjectTasks/Create
+        [Authorize]
         public ActionResult Create()
         {
             ViewBag.project_id = new SelectList(db.Projects, "id", "name");
@@ -48,6 +49,7 @@ namespace Projects.Controllers
         // POST: ProjectTasks/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]
         [HttpPost]
         [ValidateAntiForgeryToken]
         public ActionResult Create([Bind(Include = "id,project_id,name,description,created_at,updated_at,task_status_id,user_id")] ProjectTask projectTask)
@@ -68,6 +70,7 @@ namespace Projects.Controllers
         }
 
         // GET: ProjectTasks/Edit/5
+        [Authorize]
         public ActionResult Edit(int? id)
         {
             if (id == null)
@@ -88,6 +91,7 @@ namespace Projects.Controllers
         // POST: ProjectTasks/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]
         [HttpPost]
         [ValidateAntiForgeryToken]
         public ActionResult Edit([Bind(Include = "id,project_id,name,description,task_status_id,user_id,created_at")] ProjectTask projectTask)
@@ -106,6 +110,7 @@ namespace Projects.Controllers
         }
 
         // GET: ProjectTasks/Delete/5
+        [Authorize(Roles = "admin")]
         public ActionResult Delete(int? id)
         {
             if (id == null)
@@ -121,6 +126,7 @@ namespace Projects.Controllers
         }
 
         // POST: ProjectTasks/Delete/5
+        [Authorize(Roles = "admin")]
         [HttpPost, ActionName("Delete")]
         [ValidateAntiForgeryToken]
         public ActionResult DeleteConfirmed(int id)