Files
jdescopingtool/OLD/WebInterface/Controllers/CrudController.cs
T
Joseph Doherty 26ff8d9b4f Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
2026-01-02 07:43:29 -05:00

42 lines
1.1 KiB
C#
Executable File

using System;
using System.Security.Claims;
using System.Security.Principal;
using System.Web.Mvc;
using DataModel.Models;
using WebInterface.Security;
namespace WebInterface.Controllers
{
public class CrudController : Controller
{
protected internal IPrincipal CurrentPrincipal
{
get { return HttpContext.User; }
}
protected internal LDAPEntry CurrentUser
{
get
{
LDAPEntry result = null;
try
{
ClaimsIdentity claimsIdentity = CurrentPrincipal.Identity as ClaimsIdentity;
if (claimsIdentity != null)
{
UserIdentity identity = new UserIdentity((ClaimsIdentity)HttpContext.User.Identity);
result = identity.ToLDAPEntry();
}
}
catch (Exception)
{
}
return result;
}
}
}
}