-
Notifications
You must be signed in to change notification settings - Fork 11
/
ApplicationUserLoginInfo.cs
36 lines (31 loc) · 1.59 KB
/
ApplicationUserLoginInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using DevExpress.ExpressApp.ConditionalAppearance;
using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace MySolution.Module.BusinessObjects {
[DeferredDeletion(false)]
[Persistent("PermissionPolicyUserLoginInfo")]
public class ApplicationUserLoginInfo : BaseObject, ISecurityUserLoginInfo {
private string loginProviderName;
private ApplicationUser user;
private string providerUserKey;
public ApplicationUserLoginInfo(Session session) : base(session) { }
[Indexed("ProviderUserKey", Unique = true)]
[Appearance("PasswordProvider", Enabled = false, Criteria = "!(IsNewObject(this)) and LoginProviderName == '" + SecurityDefaults.PasswordAuthentication + "'", Context = "DetailView")]
public string LoginProviderName {
get { return loginProviderName; }
set { SetPropertyValue(nameof(LoginProviderName), ref loginProviderName, value); }
}
[Appearance("PasswordProviderUserKey", Enabled = false, Criteria = "!(IsNewObject(this)) and LoginProviderName == '" + SecurityDefaults.PasswordAuthentication + "'", Context = "DetailView")]
public string ProviderUserKey {
get { return providerUserKey; }
set { SetPropertyValue(nameof(ProviderUserKey), ref providerUserKey, value); }
}
[Association("User-LoginInfo")]
public ApplicationUser User {
get { return user; }
set { SetPropertyValue(nameof(User), ref user, value); }
}
object ISecurityUserLoginInfo.User => User;
}
}