Class BackOfficeIdentityUser
Inheritance
System.Object
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public class BackOfficeIdentityUser : IdentityUser<int, IIdentityUserLogin, IdentityUserRole<string>, IdentityUserClaim<int>>, IUser<int>, IRememberBeingDirty, ICanBeDirty
Constructors
BackOfficeIdentityUser(Int32, IEnumerable<IReadOnlyUserGroup>)
Creates an existing user with the specified groups
Declaration
public BackOfficeIdentityUser(int userId, IEnumerable<IReadOnlyUserGroup> groups)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
System.Collections.Generic.IEnumerable<IReadOnlyUserGroup> |
groups |
|
Properties
AccessFailedCount
Override AccessFailedCount so we can track changes to it
Declaration
public override int AccessFailedCount { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
AllowedSections
This is a readonly list of the user's allowed sections which are based on it's user groups
Declaration
public string[] AllowedSections { get; }
Property Value
Type |
Description |
System.String[] |
|
CalculatedContentStartNodeIds
Declaration
public int[] CalculatedContentStartNodeIds { get; }
Property Value
Type |
Description |
System.Int32[] |
|
Declaration
public int[] CalculatedMediaStartNodeIds { get; }
Property Value
Type |
Description |
System.Int32[] |
|
Culture
Declaration
public string Culture { get; set; }
Property Value
Type |
Description |
System.String |
|
Email
Override Email so we can track changes to it
Declaration
public override string Email { get; set; }
Property Value
Type |
Description |
System.String |
|
EmailConfirmed
Override EmailConfirmed so we can track changes to it
Declaration
public override bool EmailConfirmed { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Groups
Declaration
public IReadOnlyUserGroup[] Groups { get; set; }
Property Value
HasIdentity
Returns true if an Id has been set on this object this will be false if the object is new and not peristed to the database
Declaration
public bool HasIdentity { get; }
Property Value
Type |
Description |
System.Boolean |
|
Id
Declaration
public override int Id { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
LastLoginDateUtc
Override LastLoginDateUtc so we can track changes to it
Declaration
public override DateTime? LastLoginDateUtc { get; set; }
Property Value
Type |
Description |
System.Nullable<System.DateTime> |
|
LockoutEnabled
Lockout is always enabled
Declaration
public override bool LockoutEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Logins
Overridden to make the retrieval lazy
Declaration
public override ICollection<IIdentityUserLogin> Logins { get; }
Property Value
Name
Gets/sets the user's real name
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
PasswordHash
Override PasswordHash so we can track changes to it
Declaration
public override string PasswordHash { get; set; }
Property Value
Type |
Description |
System.String |
|
Roles
Override Roles because the value of these are the user's group aliases
Declaration
public override ICollection<IdentityUserRole<string>> Roles { get; }
Property Value
Type |
Description |
System.Collections.Generic.ICollection<IdentityUserRole<System.String>> |
|
StartContentIds
Content start nodes assigned to the User (not ones assigned to the user's groups)
Declaration
public int[] StartContentIds { get; set; }
Property Value
Type |
Description |
System.Int32[] |
|
Media start nodes assigned to the User (not ones assigned to the user's groups)
Declaration
public int[] StartMediaIds { get; set; }
Property Value
Type |
Description |
System.Int32[] |
|
UserName
Override UserName so we can track changes to it
Declaration
public override string UserName { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
AddRole(String)
helper method to easily add a role without having to deal with IdentityUserRole{T}
Declaration
public void AddRole(string role)
Parameters
Type |
Name |
Description |
System.String |
role |
|
CreateNew(String, String, String)
Used to construct a new instance without an identity
Declaration
public static BackOfficeIdentityUser CreateNew(string username, string email, string culture)
Parameters
Type |
Name |
Description |
System.String |
username |
|
System.String |
email |
This is allowed to be null (but would need to be filled in if trying to persist this instance)
|
System.String |
culture |
|
Returns
DisableChangeTracking()
Declaration
public void DisableChangeTracking()
EnableChangeTracking()
Declaration
public void EnableChangeTracking()
GenerateUserIdentityAsync(BackOfficeUserManager<BackOfficeIdentityUser>)
Declaration
public virtual Task<ClaimsIdentity> GenerateUserIdentityAsync(BackOfficeUserManager<BackOfficeIdentityUser> manager)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity> |
|
IsDirty()
Since this class only has change tracking turned on for Email/Username this will return true if either of those have changed
Declaration
Returns
Type |
Description |
System.Boolean |
|
IsPropertyDirty(String)
Returns true if the specified property is dirty
Declaration
public bool IsPropertyDirty(string propName)
Parameters
Type |
Name |
Description |
System.String |
propName |
|
Returns
Type |
Description |
System.Boolean |
|
ResetDirtyProperties(Boolean)
Declaration
public void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
Parameters
Type |
Name |
Description |
System.Boolean |
rememberPreviouslyChangedProperties |
|
SetLoginsCallback(Lazy<IEnumerable<IIdentityUserLogin>>)
Used to set a lazy call back to populate the user's Login list
Declaration
public void SetLoginsCallback(Lazy<IEnumerable<IIdentityUserLogin>> callback)
Parameters
Type |
Name |
Description |
System.Lazy<System.Collections.Generic.IEnumerable<IIdentityUserLogin>> |
callback |
|
Explicit Interface Implementations
ICanBeDirty.ResetDirtyProperties()
Declaration
void ICanBeDirty.ResetDirtyProperties()
IRememberBeingDirty.ForgetPreviouslyDirtyProperties()
Declaration
void IRememberBeingDirty.ForgetPreviouslyDirtyProperties()
IRememberBeingDirty.WasDirty()
Declaration
bool IRememberBeingDirty.WasDirty()
Returns
Type |
Description |
System.Boolean |
|
IRememberBeingDirty.WasPropertyDirty(String)
Declaration
bool IRememberBeingDirty.WasPropertyDirty(string propertyName)
Parameters
Type |
Name |
Description |
System.String |
propertyName |
|
Returns
Type |
Description |
System.Boolean |
|