39 lines
1.0 KiB
C#
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; }
|
|
}
|
|
} |