Custom logging
[wsti_pai.git] / Projects / Controllers / ProjectsController.cs
index b6f57e603962ab524df4f0eeb5fcf27c5cfd70eb..ab93cc85bce70c71f4743b01ca85b7a49f649323 100644 (file)
@@ -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)