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.
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user