authorize?
This commit is contained in:
parent
055eb14607
commit
1cb8356134
1 changed files with 4 additions and 0 deletions
|
|
@ -1,12 +1,15 @@
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNet.Authorization;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNet.Mvc;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
|
using Yavsc.Exceptions;
|
||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
|
|
||||||
namespace Yavsc.Controllers.Generic
|
namespace Yavsc.Controllers.Generic
|
||||||
{
|
{
|
||||||
|
[Authorize]
|
||||||
public abstract class SettingsController<TSettings> : Controller where TSettings : class, ISpecializationSettings, new()
|
public abstract class SettingsController<TSettings> : Controller where TSettings : class, ISpecializationSettings, new()
|
||||||
{
|
{
|
||||||
protected ApplicationDbContext _context;
|
protected ApplicationDbContext _context;
|
||||||
|
|
@ -20,6 +23,7 @@ namespace Yavsc.Controllers.Generic
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
dbSet=_context.GetDbSet<TSettings>();
|
dbSet=_context.GetDbSet<TSettings>();
|
||||||
|
if (dbSet==null) throw new InvalidWorkflowModelException(this.GetType().Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IActionResult> Index()
|
public async Task<IActionResult> Index()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue