Set all admin controllers as requiring authorization.

This commit is contained in:
2019-05-18 03:02:49 +01:00
parent 3706035509
commit 531d23599b
14 changed files with 37 additions and 40 deletions

View File

@@ -31,12 +31,14 @@
using System.Linq;
using System.Threading.Tasks;
using Cicm.Database.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace cicm_web.Areas.Admin.Controllers
{
[Area("Admin")]
[Authorize]
public class InstructionSetsController : Controller
{
readonly cicmContext _context;
@@ -47,10 +49,7 @@ namespace cicm_web.Areas.Admin.Controllers
}
// GET: Admin/InstructionSets
public async Task<IActionResult> Index()
{
return View(await _context.InstructionSets.ToListAsync());
}
public async Task<IActionResult> Index() => View(await _context.InstructionSets.ToListAsync());
// GET: Admin/InstructionSets/Details/5
public async Task<IActionResult> Details(int? id)
@@ -64,10 +63,7 @@ namespace cicm_web.Areas.Admin.Controllers
}
// GET: Admin/InstructionSets/Create
public IActionResult Create()
{
return View();
}
public IActionResult Create() => View();
// POST: Admin/InstructionSets/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for