Add AuthorizeAttribute to all admin controllers

This commit is contained in:
2019-11-08 00:37:51 +00:00
parent aff14cdaa7
commit ad2d2bbf37
31 changed files with 86 additions and 24 deletions

View File

@@ -1,12 +1,14 @@
using System.Linq;
using System.Threading.Tasks;
using DiscImageChef.Server.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace DiscImageChef.Server.Areas.Admin.Controllers
{
[Area("Admin")]
[Authorize]
public class MediaFormatsController : Controller
{
readonly DicServerContext _context;
@@ -38,7 +40,7 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
public IActionResult Create() => View();
// POST: Admin/MediaFormats/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// 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.
[HttpPost, ValidateAntiForgeryToken]
public async Task<IActionResult> Create([Bind("Id,Name,Count")] MediaFormat mediaFormat)
@@ -73,7 +75,7 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
}
// POST: Admin/MediaFormats/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// 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.
[HttpPost, ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(int id, [Bind("Id,Name,Count")] MediaFormat mediaFormat)