20 lines
409 B
C#
20 lines
409 B
C#
using System.Linq;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Website
|
|
{
|
|
public class AdminController : Controller
|
|
{
|
|
[Authorize(Policy = "IsAdmin")]
|
|
// [Authorize(Roles = "Administrator")]
|
|
public IActionResult Index()
|
|
{
|
|
return Json(new
|
|
{
|
|
Name = User.Identity.Name,
|
|
ClaimsCount = User.Claims.Count()
|
|
});
|
|
}
|
|
}
|
|
} |