Class BackOfficeIdentityUser
Inheritance
Namespace: Umbraco.Core.Models.Identity
Assembly: Umbraco.Core.dll
Syntax
public class BackOfficeIdentityUser : IdentityUser<int, IIdentityUserLogin, IdentityUserRole<string>, IdentityUserClaim<int>>, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceBackOfficeIdentityUser(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
View SourceAccessFailedCount
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[] |
CalculatedMediaStartNodeIds
Declaration
public int[] CalculatedMediaStartNodeIds { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
Culture
Declaration
public string Culture { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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
Type | Description |
---|---|
IReadOnlyUserGroup[] |
HasIdentity
Returns true if an Id has been set on this object this will be false if the object is new and not persisted 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> |
LastPasswordChangeDateUtc
LastPasswordChangeDateUtc so we can track changes to it
Declaration
public override DateTime? LastPasswordChangeDateUtc { 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
Type | Description |
---|---|
System.Collections.Generic.ICollection<IIdentityUserLogin> |
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[] |
StartMediaIds
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
View SourceAddRole(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 |
Remarks
Adding a role this way will not reflect on the user's group's collection or it's allowed sections until the user is persisted
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 | This is allowed to be null (but would need to be filled in if trying to persist this instance) |
|
System.String | culture |
Returns
Type | Description |
---|---|
BackOfficeIdentityUser |
DisableChangeTracking()
Disables change tracking.
Declaration
public void DisableChangeTracking()
EnableChangeTracking()
Enables change tracking.
Declaration
public void EnableChangeTracking()
GetDirtyProperties()
Gets properties that are dirty.
Declaration
public IEnumerable<string> GetDirtyProperties()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
GetWereDirtyProperties()
Gets properties that were dirty.
Declaration
public IEnumerable<string> GetWereDirtyProperties()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
IsDirty()
Determines whether the current entity is dirty.
Declaration
public bool IsDirty()
Returns
Type | Description |
---|---|
System.Boolean |
IsPropertyDirty(String)
Determines whether a specific property is dirty.
Declaration
public bool IsPropertyDirty(string propName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName |
Returns
Type | Description |
---|---|
System.Boolean |
ResetDirtyProperties()
Resets dirty properties.
Declaration
public void ResetDirtyProperties()
ResetDirtyProperties(Boolean)
Resets dirty properties.
Declaration
public void ResetDirtyProperties(bool rememberDirty)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | rememberDirty | A value indicating whether to remember dirty properties. |
Remarks
When rememberDirty
is true, dirty properties are saved so they can be checked with WasDirty.
ResetWereDirtyProperties()
Resets properties that were dirty.
Declaration
public void ResetWereDirtyProperties()
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 |
WasDirty()
Determines whether the current entity is dirty.
Declaration
public bool WasDirty()
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
A property was dirty if it had been changed and the changes were committed.
WasPropertyDirty(String)
Determines whether a specific property was dirty.
Declaration
public bool WasPropertyDirty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
A property was dirty if it had been changed and the changes were committed.