56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using System.ComponentModel;
|
|
using System.Text;
|
|
using DevExpress.ExpressApp;
|
|
using DevExpress.ExpressApp.Security;
|
|
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
|
|
using DevExpress.Xpo;
|
|
|
|
namespace DurnyklyYol.Module.BusinessObjects;
|
|
|
|
[MapInheritance(MapInheritanceType.ParentTable)]
|
|
[DefaultProperty(nameof(UserName))]
|
|
public class ApplicationUser : PermissionPolicyUser, ISecurityUserWithLoginInfo, ISecurityUserLockout {
|
|
bool suspended;
|
|
private int accessFailedCount;
|
|
private DateTime lockoutEnd;
|
|
|
|
public ApplicationUser(Session session) : base(session) { }
|
|
|
|
[Browsable(false)]
|
|
public int AccessFailedCount
|
|
{
|
|
get { return accessFailedCount; }
|
|
set { SetPropertyValue(nameof(AccessFailedCount), ref accessFailedCount, value); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public DateTime LockoutEnd
|
|
{
|
|
get { return lockoutEnd; }
|
|
set { SetPropertyValue(nameof(LockoutEnd), ref lockoutEnd, value); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
[Aggregated, Association("User-LoginInfo")]
|
|
public XPCollection<ApplicationUserLoginInfo> LoginInfo
|
|
{
|
|
get { return GetCollection<ApplicationUserLoginInfo>(nameof(LoginInfo)); }
|
|
}
|
|
|
|
IEnumerable<ISecurityUserLoginInfo> IOAuthSecurityUser.UserLogins => LoginInfo.OfType<ISecurityUserLoginInfo>();
|
|
|
|
ISecurityUserLoginInfo ISecurityUserWithLoginInfo.CreateUserLoginInfo(string loginProviderName, string providerUserKey)
|
|
{
|
|
ApplicationUserLoginInfo result = new ApplicationUserLoginInfo(Session);
|
|
result.LoginProviderName = loginProviderName;
|
|
result.ProviderUserKey = providerUserKey;
|
|
result.User = this;
|
|
return result;
|
|
}
|
|
public bool Suspended
|
|
{
|
|
get => suspended;
|
|
set => SetPropertyValue(nameof(Suspended), ref suspended, value);
|
|
}
|
|
}
|