EchoTex_Payroll/HRM.UI/Controllers/MobileAPI/Components/CustomPrincipal.cs
2024-10-14 10:01:49 +06:00

39 lines
1.0 KiB
C#

using Payroll.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using HRM.BO;
namespace HRM.UI.Components
{
public class CustomPrincipal : IPrincipal
{
public CustomPrincipal(EmpMobile oEmpMobile)
{
identity = new CustomIIDentity(oEmpMobile.DeviceNO, "Basic", true);
}
private IIdentity identity;
public IIdentity Identity { get { return identity; } }
public bool IsInRole(string role)
{
return true;
}
}
public class CustomIIDentity : IIdentity
{
public CustomIIDentity(string name, string authenticationType, bool isAuthenticated)
{
Name = name;
AuthenticationType = authenticationType;
IsAuthenticated = isAuthenticated;
}
public string Name { get; set; }
public string AuthenticationType { get; set; }
public bool IsAuthenticated { get; set; }
}
}