Class MemberRoleStore
A custom user store that uses Umbraco member data
Inheritance
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MemberRoleStore
Constructors
View SourceMemberRoleStore(IMemberGroupService, IdentityErrorDescriber)
Declaration
public MemberRoleStore(IMemberGroupService memberGroupService, IdentityErrorDescriber errorDescriber)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberGroupService | memberGroupService | |
| IdentityErrorDescriber | errorDescriber |
Properties
View SourceErrorDescriber
Gets or sets the Microsoft.AspNetCore.Identity.IdentityErrorDescriber for any error that occurred with the current operation.
Declaration
public IdentityErrorDescriber ErrorDescriber { get; set; }
Property Value
| Type | Description |
|---|---|
| IdentityErrorDescriber |
Roles
Returns an System.Linq.IQueryable<T> collection of roles.
Declaration
public IQueryable<UmbracoIdentityRole> Roles { get; }
Property Value
| Type | Description |
|---|---|
| IQueryable<UmbracoIdentityRole> | An System.Linq.IQueryable<T> collection of roles. |
Methods
View SourceCreateAsync(UmbracoIdentityRole, CancellationToken)
Creates a new role in a store as an asynchronous operation.
Declaration
public Task<IdentityResult> CreateAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role to create in the store. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<IdentityResult> | A System.Threading.Tasks.Task<TResult> that represents the Microsoft.AspNetCore.Identity.IdentityResult of the asynchronous query. |
DeleteAsync(UmbracoIdentityRole, CancellationToken)
Deletes a role from the store as an asynchronous operation.
Declaration
public Task<IdentityResult> DeleteAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role to delete from the store. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<IdentityResult> | A System.Threading.Tasks.Task<TResult> that represents the Microsoft.AspNetCore.Identity.IdentityResult of the asynchronous query. |
Dispose()
Dispose the store
Declaration
public void Dispose()
FindByIdAsync(string, CancellationToken)
Finds the role who has the specified ID as an asynchronous operation.
Declaration
public Task<UmbracoIdentityRole?> FindByIdAsync(string roleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | roleId | The role ID to look for. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<UmbracoIdentityRole> | A System.Threading.Tasks.Task<TResult> that result of the look up. |
FindByNameAsync(string, CancellationToken)
Finds the role who has the specified normalized name as an asynchronous operation.
Declaration
public Task<UmbracoIdentityRole?> FindByNameAsync(string name, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<UmbracoIdentityRole> | A System.Threading.Tasks.Task<TResult> that result of the look up. |
GetNormalizedRoleNameAsync(UmbracoIdentityRole, CancellationToken)
Get a role's normalized name as an asynchronous operation.
Declaration
public Task<string?> GetNormalizedRoleNameAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role whose normalized name should be retrieved. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<string> | A System.Threading.Tasks.Task<TResult> that contains the name of the role. |
GetRoleIdAsync(UmbracoIdentityRole, CancellationToken)
Gets the ID for a role from the store as an asynchronous operation.
Declaration
public Task<string> GetRoleIdAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role whose ID should be returned. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<string> | A System.Threading.Tasks.Task<TResult> that contains the ID of the role. |
GetRoleNameAsync(UmbracoIdentityRole, CancellationToken)
Gets the name of a role from the store as an asynchronous operation.
Declaration
public Task<string?> GetRoleNameAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role whose name should be returned. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<string> | A System.Threading.Tasks.Task<TResult> that contains the name of the role. |
SetNormalizedRoleNameAsync(UmbracoIdentityRole, string?, CancellationToken)
Set a role's normalized name as an asynchronous operation.
Declaration
public Task SetNormalizedRoleNameAsync(UmbracoIdentityRole role, string? normalizedName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role whose normalized name should be set. |
| string | normalizedName | The normalized name to set |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task | The System.Threading.Tasks.Task that represents the asynchronous operation. |
SetRoleNameAsync(UmbracoIdentityRole, string?, CancellationToken)
Sets the name of a role in the store as an asynchronous operation.
Declaration
public Task SetRoleNameAsync(UmbracoIdentityRole role, string? roleName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role whose name should be set. |
| string | roleName | The name of the role. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task | The System.Threading.Tasks.Task that represents the asynchronous operation. |
ThrowIfDisposed()
Throws if this class has been disposed.
Declaration
protected void ThrowIfDisposed()
UpdateAsync(UmbracoIdentityRole, CancellationToken)
Updates a role in a store as an asynchronous operation.
Declaration
public Task<IdentityResult> UpdateAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoIdentityRole | role | The role to update in the store. |
| CancellationToken | cancellationToken | The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
| Type | Description |
|---|---|
| Task<IdentityResult> | A System.Threading.Tasks.Task<TResult> that represents the Microsoft.AspNetCore.Identity.IdentityResult of the asynchronous query. |