Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoIdentityUser

    Abstract class for use in Umbraco Identity for users and members

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Security
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class UmbracoIdentityUser : IdentityUser, IRememberBeingDirty, ICanBeDirty
    Remarks

    This uses strings for the ID of the user, claims, roles. This is because aspnetcore identity's base store will not support having an INT user PK and a string role PK with the way they've made the generics. So we will just use string for both which makes things more flexible anyways for users and members and also if/when we transition to GUID support

    This class was originally borrowed from the EF implementation in Identity prior to netcore. The new IdentityUser in netcore does not have properties such as Claims, Roles and Logins and those are instead by default managed with their default user store backed by EF which utilizes EF's change tracking to track these values to a user. We will continue using this approach since it works fine for what we need which does the change tracking of claims, roles and logins directly on the user model.

    Constructors

    View Source

    UmbracoIdentityUser()

    Initializes a new instance of the UmbracoIdentityUser class.

    Declaration
    public UmbracoIdentityUser()

    Properties

    View Source

    AccessFailedCount

    Gets or sets the value to record failures for the purposes of lockout

    Declaration
    public override int AccessFailedCount { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    BeingDirty

    Gets the BeingDirty for change tracking

    Declaration
    protected BeingDirty BeingDirty { get; }
    Property Value
    Type Description
    BeingDirty
    View Source

    Claims

    Gets navigation the user claims collection

    Declaration
    public ICollection<IdentityUserClaim<string>> Claims { get; }
    Property Value
    Type Description
    ICollection<IdentityUserClaim<System.String>>
    View Source

    ConcurrencyStamp

    Declaration
    public override string ConcurrencyStamp { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Email

    Gets or sets email

    Declaration
    public override string Email { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    EmailConfirmed

    Gets or sets a value indicating whether the email is confirmed, default is false

    Declaration
    public override bool EmailConfirmed { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    HasIdentity

    Gets or sets a value indicating whether returns 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; protected set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Id

    Gets or sets user ID (Primary Key)

    Declaration
    public override string Id { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    IsApproved

    Gets or sets a value indicating whether the IUser IsApproved

    Declaration
    public bool IsApproved { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    IsLockedOut

    Gets a value indicating whether the user is locked out based on the user's lockout end date

    Declaration
    public bool IsLockedOut { get; }
    Property Value
    Type Description
    System.Boolean
    View Source

    LastLoginDateUtc

    Gets or sets last login date

    Declaration
    public DateTime? LastLoginDateUtc { get; set; }
    Property Value
    Type Description
    System.Nullable<DateTime>
    View Source

    LastPasswordChangeDateUtc

    Gets or sets dateTime in UTC when the password was last changed.

    Declaration
    public DateTime? LastPasswordChangeDateUtc { get; set; }
    Property Value
    Type Description
    System.Nullable<DateTime>
    View Source

    LockoutEnabled

    Gets or sets a value indicating whether is lockout enabled for this user

    Declaration
    public override bool LockoutEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Currently this is always true for users and members

    View Source

    Logins

    Gets the user logins collection

    Declaration
    public ICollection<IIdentityUserLogin> Logins { get; }
    Property Value
    Type Description
    ICollection<IIdentityUserLogin>
    View Source

    LoginTokens

    Gets the external login tokens collection

    Declaration
    public ICollection<IIdentityUserToken> LoginTokens { get; }
    Property Value
    Type Description
    ICollection<IIdentityUserToken>
    View Source

    Name

    Gets or sets the user's real name

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    PasswordConfig

    Gets or sets the password config

    Declaration
    public string PasswordConfig { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    PasswordHash

    Gets or sets the salted/hashed form of the user password

    Declaration
    public override string PasswordHash { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Roles

    Gets or sets the user roles collection

    Declaration
    public ICollection<IdentityUserRole<string>> Roles { get; set; }
    Property Value
    Type Description
    ICollection<IdentityUserRole<System.String>>
    View Source

    UserName

    Gets or sets user name

    Declaration
    public override string UserName { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    View Source

    AddRole(String)

    Adds a role

    Declaration
    public void AddRole(string role)
    Parameters
    Type Name Description
    System.String role

    The role to add

    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

    View Source

    DisableChangeTracking()

    Disables change tracking.

    Declaration
    public void DisableChangeTracking()
    View Source

    EnableChangeTracking()

    Enables change tracking.

    Declaration
    public void EnableChangeTracking()
    View Source

    GetDirtyProperties()

    Declaration
    public IEnumerable<string> GetDirtyProperties()
    Returns
    Type Description
    IEnumerable<System.String>
    View Source

    GetWereDirtyProperties()

    Declaration
    public IEnumerable<string> GetWereDirtyProperties()
    Returns
    Type Description
    IEnumerable<System.String>
    View Source

    IsDirty()

    Determines whether the current entity is dirty.

    Declaration
    public bool IsDirty()
    Returns
    Type Description
    System.Boolean
    View Source

    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
    View Source

    ResetDirtyProperties()

    Resets dirty properties.

    Declaration
    public void ResetDirtyProperties()
    View Source

    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.

    View Source

    ResetWereDirtyProperties()

    Resets properties that were dirty.

    Declaration
    public void ResetWereDirtyProperties()
    View Source

    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.

    View Source

    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.

    Events

    View Source

    PropertyChanged

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • UmbracoIdentityUser()
    • Properties
      • AccessFailedCount
      • BeingDirty
      • Claims
      • ConcurrencyStamp
      • Email
      • EmailConfirmed
      • HasIdentity
      • Id
      • IsApproved
      • IsLockedOut
      • LastLoginDateUtc
      • LastPasswordChangeDateUtc
      • LockoutEnabled
      • Logins
      • LoginTokens
      • Name
      • PasswordConfig
      • PasswordHash
      • Roles
      • UserName
    • Methods
      • AddRole(String)
      • DisableChangeTracking()
      • EnableChangeTracking()
      • GetDirtyProperties()
      • GetWereDirtyProperties()
      • IsDirty()
      • IsPropertyDirty(String)
      • ResetDirtyProperties()
      • ResetDirtyProperties(Boolean)
      • ResetWereDirtyProperties()
      • WasDirty()
      • WasPropertyDirty(String)
    • Events
      • PropertyChanged
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX