Show / Hide Table of Contents

Class ExtendedRoleManager<TRole>

Provides the APIs for managing roles in a persistence store.

Inheritance
Object
Microsoft.AspNetCore.Identity.RoleManager<TRole>
ExtendedRoleManager<TRole>
MultitenantRoleManager<TRole>
Inherited Members
Microsoft.AspNetCore.Identity.RoleManager<TRole>.CreateAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.UpdateNormalizedRoleNameAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.UpdateAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.RoleExistsAsync(System.String)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.NormalizeKey(System.String)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.FindByIdAsync(System.String)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.GetRoleNameAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.SetRoleNameAsync(TRole, System.String)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.GetRoleIdAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.FindByNameAsync(System.String)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.AddClaimAsync(TRole, System.Security.Claims.Claim)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.RemoveClaimAsync(TRole, System.Security.Claims.Claim)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.GetClaimsAsync(TRole)
RoleManager<TRole>.Dispose()
Microsoft.AspNetCore.Identity.RoleManager<TRole>.Dispose(System.Boolean)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.ValidateRoleAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.UpdateRoleAsync(TRole)
Microsoft.AspNetCore.Identity.RoleManager<TRole>.ThrowIfDisposed()
RoleManager<TRole>.CancellationToken
RoleManager<TRole>.Store
Microsoft.AspNetCore.Identity.RoleManager<TRole>.Logger
Microsoft.AspNetCore.Identity.RoleManager<TRole>.RoleValidators
Microsoft.AspNetCore.Identity.RoleManager<TRole>.ErrorDescriber
Microsoft.AspNetCore.Identity.RoleManager<TRole>.KeyNormalizer
RoleManager<TRole>.Roles
RoleManager<TRole>.SupportsQueryableRoles
Microsoft.AspNetCore.Identity.RoleManager<TRole>.SupportsRoleClaims
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class ExtendedRoleManager<TRole> : RoleManager<TRole>, IDisposable where TRole : class, IRole, new()
Type Parameters
TRole

The type encapsulating a role.

Constructors

ExtendedRoleManager(IRoleStore<TRole>, IEnumerable<IRoleValidator<TRole>>, IServiceProvider, ILookupNormalizer, IdentityErrorDescriber, ILogger<ExtendedRoleManager<TRole>>)

Constructs a new instance of ExtendedRoleManager<TRole>.

Declaration
public ExtendedRoleManager(IRoleStore<TRole> store, IEnumerable<IRoleValidator<TRole>> roleValidators, IServiceProvider services, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, ILogger<ExtendedRoleManager<TRole>> logger)
Parameters
IRoleStore<TRole> store

The persistence store the manager will operate over.

IEnumerable<Microsoft.AspNetCore.Identity.IRoleValidator<TRole>> roleValidators

A collection of validators for roles.

System.IServiceProvider services

The System.IServiceProvider used to resolve services.

Microsoft.AspNetCore.Identity.ILookupNormalizer keyNormalizer

The normalizer to use when normalizing role names to keys.

Microsoft.AspNetCore.Identity.IdentityErrorDescriber errors

The Microsoft.AspNetCore.Identity.IdentityErrorDescriber used to provider error messages.

Microsoft.Extensions.Logging.ILogger<ExtendedRoleManager<TRole>> logger

The logger used to log messages, warnings and errors.

Methods

AddPermissionAsync(TRole, String)

Adds the specified permission to the role.

Declaration
public virtual async Task<IdentityResult> AddPermissionAsync(TRole role, string permission)
Parameters
TRole role

The role to add the permission to.

String permission

The Permission to add.

Returns
System.Threading.Tasks.Task<IdentityResult>

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult for the add.

CreateFromTemplateAsync(IRoleTemplate, Nullable<Guid>)

Creates a new role from the specified template in the persistence store.

Declaration
public virtual async Task<IdentityResult> CreateFromTemplateAsync(IRoleTemplate template, Guid? tenantId = null)
Parameters
IRoleTemplate template

The IRoleTemplate to create a new role for.

System.Nullable<System.Guid> tenantId

The identity of the tenant that the role should be created for.

Returns
System.Threading.Tasks.Task<IdentityResult>

The System.Threading.Tasks.Task that represents the asynchronous operation.

CreateRoleFromTemplateAsync(IRoleTemplate)

Creates a new instance of TRole based on the specified template.

Declaration
protected virtual async Task<IdentityResult> CreateRoleFromTemplateAsync(IRoleTemplate template)
Parameters
IRoleTemplate template

The IRoleTemplate to create a new role for.

Returns
System.Threading.Tasks.Task<IdentityResult>

A new instance of TRole.

DeleteAsync(TRole)

Declaration
public override Task<IdentityResult> DeleteAsync(TRole role)
Parameters
TRole role

Returns
System.Threading.Tasks.Task<IdentityResult>

Overrides
Microsoft.AspNetCore.Identity.RoleManager<TRole>.DeleteAsync(TRole)

GetAllRolesAsync(RolesSearchQuery)

Gets all roles.

Declaration
public virtual Task<QueryResult<TRole>> GetAllRolesAsync(RolesSearchQuery query)
Parameters
RolesSearchQuery query

The query describing filtering and sorting for the roles.

Returns
System.Threading.Tasks.Task<QueryResult<TRole>>

A System.Threading.Tasks.Task that represents the QueryResult<T> of the asynchronous query.

GetUserRolesAsync(Guid)

Retrieves the roles the specified userId is a member of.

Declaration
public Task<List<TRole>> GetUserRolesAsync(Guid userId)
Parameters
System.Guid userId

The id of the user whose roles should be retrieved.

Returns
System.Threading.Tasks.Task<List<TRole>>

A System.Threading.Tasks.Task<TResult> that contains the roles the user is a member of.

RemovePermissionAsync(TRole, String)

Removes the specified permission from the role.

Declaration
public virtual async Task<IdentityResult> RemovePermissionAsync(TRole role, string permission)
Parameters
TRole role

The role to remove the permission from.

String permission

The identity of the functionality to remove permission for.

Returns
System.Threading.Tasks.Task<IdentityResult>

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult for the remove.

UpdateRoleFromTemplateAsync(TRole, IRoleTemplate)

Updates the existing instance of existingRole based on the specified template.

Declaration
protected virtual async Task<IdentityResult> UpdateRoleFromTemplateAsync(TRole existingRole, IRoleTemplate template)
Parameters
TRole existingRole

The existing role to update from template.

IRoleTemplate template

The IRoleTemplate to create a new role for.

Returns
System.Threading.Tasks.Task<IdentityResult>

The System.Threading.Tasks.Task that represents the asynchronous operation.

Back to top Generated by DocFX