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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
@*
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
}
|
||||
THIS IS ADMIN HOME
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>@ViewBag.Title</title>
|
||||
</head>
|
||||
<body>
|
||||
DOPE
|
||||
<div>
|
||||
@RenderBody()
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,3 @@
|
||||
@using FJPSite
|
||||
@using FJPSite.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
Reference in New Issue
Block a user