Search Results for

    Show / Hide Table of Contents
    View Source

    Class MemberManager

    Inheritance
    object
    UserManager<MemberIdentityUser>
    UmbracoUserManager<MemberIdentityUser, MemberPasswordConfigurationSettings>
    Namespace: Umbraco.Cms.Web.Common.Security
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswordConfigurationSettings>, IMemberManager, IUmbracoUserManager<MemberIdentityUser>

    Constructors

    View Source

    MemberManager(IIpResolver, IMemberUserStore, IOptions<IdentityOptions>, IPasswordHasher<MemberIdentityUser>, IEnumerable<IUserValidator<MemberIdentityUser>>, IEnumerable<IPasswordValidator<MemberIdentityUser>>, IdentityErrorDescriber, IServiceProvider, ILogger<UserManager<MemberIdentityUser>>, IOptionsSnapshot<MemberPasswordConfigurationSettings>, IPublicAccessService, IHttpContextAccessor)

    Declaration
    [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 19.")]
    public MemberManager(IIpResolver ipResolver, IMemberUserStore store, IOptions<IdentityOptions> optionsAccessor, IPasswordHasher<MemberIdentityUser> passwordHasher, IEnumerable<IUserValidator<MemberIdentityUser>> userValidators, IEnumerable<IPasswordValidator<MemberIdentityUser>> passwordValidators, IdentityErrorDescriber errors, IServiceProvider services, ILogger<UserManager<MemberIdentityUser>> logger, IOptionsSnapshot<MemberPasswordConfigurationSettings> passwordConfiguration, IPublicAccessService publicAccessService, IHttpContextAccessor httpContextAccessor)
    Parameters
    Type Name Description
    IIpResolver ipResolver
    IMemberUserStore store
    IOptions<IdentityOptions> optionsAccessor
    IPasswordHasher<MemberIdentityUser> passwordHasher
    IEnumerable<IUserValidator<MemberIdentityUser>> userValidators
    IEnumerable<IPasswordValidator<MemberIdentityUser>> passwordValidators
    IdentityErrorDescriber errors
    IServiceProvider services
    ILogger<UserManager<MemberIdentityUser>> logger
    IOptionsSnapshot<MemberPasswordConfigurationSettings> passwordConfiguration
    IPublicAccessService publicAccessService
    IHttpContextAccessor httpContextAccessor
    View Source

    MemberManager(IIpResolver, IMemberUserStore, IOptions<IdentityOptions>, IPasswordHasher<MemberIdentityUser>, IEnumerable<IUserValidator<MemberIdentityUser>>, IEnumerable<IPasswordValidator<MemberIdentityUser>>, IdentityErrorDescriber, IServiceProvider, ILogger<UserManager<MemberIdentityUser>>, IOptionsSnapshot<MemberPasswordConfigurationSettings>, IPublicAccessService, IHttpContextAccessor, IPublishedModelFactory)

    Declaration
    public MemberManager(IIpResolver ipResolver, IMemberUserStore store, IOptions<IdentityOptions> optionsAccessor, IPasswordHasher<MemberIdentityUser> passwordHasher, IEnumerable<IUserValidator<MemberIdentityUser>> userValidators, IEnumerable<IPasswordValidator<MemberIdentityUser>> passwordValidators, IdentityErrorDescriber errors, IServiceProvider services, ILogger<UserManager<MemberIdentityUser>> logger, IOptionsSnapshot<MemberPasswordConfigurationSettings> passwordConfiguration, IPublicAccessService publicAccessService, IHttpContextAccessor httpContextAccessor, IPublishedModelFactory publishedModelFactory)
    Parameters
    Type Name Description
    IIpResolver ipResolver
    IMemberUserStore store
    IOptions<IdentityOptions> optionsAccessor
    IPasswordHasher<MemberIdentityUser> passwordHasher
    IEnumerable<IUserValidator<MemberIdentityUser>> userValidators
    IEnumerable<IPasswordValidator<MemberIdentityUser>> passwordValidators
    IdentityErrorDescriber errors
    IServiceProvider services
    ILogger<UserManager<MemberIdentityUser>> logger
    IOptionsSnapshot<MemberPasswordConfigurationSettings> passwordConfiguration
    IPublicAccessService publicAccessService
    IHttpContextAccessor httpContextAccessor
    IPublishedModelFactory publishedModelFactory

    Methods

    View Source

    AsPublishedMember(MemberIdentityUser)

    Returns the IPublishedContent instance for the specified MemberIdentityUser

    Declaration
    public virtual IPublishedContent? AsPublishedMember(MemberIdentityUser user)
    Parameters
    Type Name Description
    MemberIdentityUser user

    The member identity user.

    Returns
    Type Description
    IPublishedContent

    The published content for the member, or null if not found.

    View Source

    GeneratePasswordResetTokenAsync(MemberIdentityUser)

    Generates a password reset token for the specified member. External-only members cannot reset passwords as they authenticate via their external provider.

    Declaration
    public override Task<string> GeneratePasswordResetTokenAsync(MemberIdentityUser user)
    Parameters
    Type Name Description
    MemberIdentityUser user

    The member to generate the reset token for.

    Returns
    Type Description
    Task<string>

    The password reset token, or throws if the member is external-only.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the member is an external-only member.

    View Source

    GetCurrentMemberAsync()

    Returns the currently logged in member if there is one, else returns null

    Declaration
    public virtual Task<MemberIdentityUser?> GetCurrentMemberAsync()
    Returns
    Type Description
    Task<MemberIdentityUser>

    The current member, or null if not logged in.

    View Source

    IsLoggedIn()

    Check if a member is logged in

    Declaration
    public virtual bool IsLoggedIn()
    Returns
    Type Description
    bool

    True if a member is logged in.

    View Source

    IsMemberAuthorizedAsync(IEnumerable<string>?, IEnumerable<string>?, IEnumerable<int>?)

    Checks if the current member is authorized based on the parameters provided.

    Declaration
    public virtual Task<bool> IsMemberAuthorizedAsync(IEnumerable<string>? allowTypes = null, IEnumerable<string>? allowGroups = null, IEnumerable<int>? allowMembers = null)
    Parameters
    Type Name Description
    IEnumerable<string> allowTypes

    Allowed types.

    IEnumerable<string> allowGroups

    Allowed groups.

    IEnumerable<int> allowMembers

    Allowed individual members.

    Returns
    Type Description
    Task<bool>

    True or false if the currently logged in member is authorized

    View Source

    IsProtectedAsync(IEnumerable<string>)

    Checks if the document objects specified by their paths are protected by the "Protect Pages" functionality in Umbraco.

    Declaration
    public virtual Task<IReadOnlyDictionary<string, bool>> IsProtectedAsync(IEnumerable<string> paths)
    Parameters
    Type Name Description
    IEnumerable<string> paths

    The full paths of the document objects to check.

    Returns
    Type Description
    Task<IReadOnlyDictionary<string, bool>>

    A task that represents the asynchronous operation. The task result contains a read-only dictionary mapping each document path to a boolean value indicating whether the corresponding document object is protected.

    View Source

    IsProtectedAsync(string)

    Check if a document object is protected by the "Protect Pages" functionality in umbraco

    Declaration
    public virtual Task<bool> IsProtectedAsync(string path)
    Parameters
    Type Name Description
    string path

    The full path of the document object to check

    Returns
    Type Description
    Task<bool>

    True if the document object is protected

    Remarks

    this is a cached call

    View Source

    MemberHasAccessAsync(IEnumerable<string>)

    Checks if the current user has access to the paths

    Declaration
    public virtual Task<IReadOnlyDictionary<string, bool>> MemberHasAccessAsync(IEnumerable<string> paths)
    Parameters
    Type Name Description
    IEnumerable<string> paths

    The document paths to check access for.

    Returns
    Type Description
    Task<IReadOnlyDictionary<string, bool>>

    A dictionary mapping each path to whether the member has access.

    View Source

    MemberHasAccessAsync(string)

    Check if the current user has access to a document

    Declaration
    public virtual Task<bool> MemberHasAccessAsync(string path)
    Parameters
    Type Name Description
    string path

    The full path of the document object to check

    Returns
    Type Description
    Task<bool>

    True if the current user has access or if the current document isn't protected

    View Source

    ResetPasswordAsync(MemberIdentityUser, string, string)

    Resets the password for the specified member using a reset token. External-only members cannot have local passwords.

    Declaration
    public override Task<IdentityResult> ResetPasswordAsync(MemberIdentityUser user, string token, string newPassword)
    Parameters
    Type Name Description
    MemberIdentityUser user

    The member whose password is being reset.

    string token

    The password reset token.

    string newPassword

    The new password.

    Returns
    Type Description
    Task<IdentityResult>

    An Microsoft.AspNetCore.Identity.IdentityResult indicating the result of the operation.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX