Granular permission back end done
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using FJPSite.Data.Identity;
|
||||
using FJPSite.Enums;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace FJPSite.Areas.Admin.Controllers;
|
||||
|
||||
[Area("Admin")]
|
||||
[Authorize]
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using FJPSite.Attributes;
|
||||
using FJPSite.Enums;
|
||||
using FJPSite.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace FJPSite.Areas.Admin.Controllers;
|
||||
|
||||
public class PermissionController : Controller
|
||||
{
|
||||
private readonly IPermissionService _permissionService;
|
||||
|
||||
public PermissionController(IPermissionService permissionService)
|
||||
{
|
||||
_permissionService = permissionService;
|
||||
}
|
||||
|
||||
[HasPermission(FeatureEnum.Permissions, ActionEnum.View)]
|
||||
public IActionResult Index()
|
||||
{
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user