mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Add AuthorizeAttribute to all admin controllers
This commit is contained in:
@@ -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 CommandsController : Controller
|
||||
{
|
||||
readonly DicServerContext _context;
|
||||
@@ -38,7 +40,7 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
public IActionResult Create() => View();
|
||||
|
||||
// POST: Admin/Commands/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")] Command command)
|
||||
@@ -73,7 +75,7 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
}
|
||||
|
||||
// POST: Admin/Commands/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")] Command command)
|
||||
|
||||
Reference in New Issue
Block a user