Require authorization for most controllers
This commit is contained in:
parent
d65ef4a280
commit
2fc43f3f34
4 changed files with 9 additions and 1 deletions
|
@ -7,9 +7,11 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using LANCommander.Data;
|
using LANCommander.Data;
|
||||||
using LANCommander.Data.Models;
|
using LANCommander.Data.Models;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace LANCommander.Controllers
|
namespace LANCommander.Controllers
|
||||||
{
|
{
|
||||||
|
[Authorize]
|
||||||
public class CompaniesController : Controller
|
public class CompaniesController : Controller
|
||||||
{
|
{
|
||||||
private readonly DatabaseContext _context;
|
private readonly DatabaseContext _context;
|
||||||
|
|
|
@ -7,9 +7,11 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using LANCommander.Data;
|
using LANCommander.Data;
|
||||||
using LANCommander.Data.Models;
|
using LANCommander.Data.Models;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace LANCommander.Controllers
|
namespace LANCommander.Controllers
|
||||||
{
|
{
|
||||||
|
[Authorize]
|
||||||
public class GamesController : Controller
|
public class GamesController : Controller
|
||||||
{
|
{
|
||||||
private readonly DatabaseContext Context;
|
private readonly DatabaseContext Context;
|
||||||
|
@ -156,7 +158,7 @@ namespace LANCommander.Controllers
|
||||||
{
|
{
|
||||||
if (Context.Games == null)
|
if (Context.Games == null)
|
||||||
{
|
{
|
||||||
return Problem("Entity set 'DatabaseContext.Games' is null.");
|
return Problem("Entity set 'DatabaseContext.Games' is null.");
|
||||||
}
|
}
|
||||||
var game = await Context.Games.FindAsync(id);
|
var game = await Context.Games.FindAsync(id);
|
||||||
if (game != null)
|
if (game != null)
|
||||||
|
|
|
@ -7,9 +7,11 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using LANCommander.Data;
|
using LANCommander.Data;
|
||||||
using LANCommander.Data.Models;
|
using LANCommander.Data.Models;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace LANCommander.Controllers
|
namespace LANCommander.Controllers
|
||||||
{
|
{
|
||||||
|
[Authorize]
|
||||||
public class TagsController : Controller
|
public class TagsController : Controller
|
||||||
{
|
{
|
||||||
private readonly DatabaseContext _context;
|
private readonly DatabaseContext _context;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
using LANCommander.Models;
|
using LANCommander.Models;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace LANCommander.Controllers
|
namespace LANCommander.Controllers
|
||||||
{
|
{
|
||||||
|
[Authorize]
|
||||||
public class UploadController : Controller
|
public class UploadController : Controller
|
||||||
{
|
{
|
||||||
private const string UploadDirectory = "Upload";
|
private const string UploadDirectory = "Upload";
|
||||||
|
|
Loading…
Add table
Reference in a new issue