Class MultitenantRoleManager<TRole>
Provides the APIs for managing roles in a persistence store in a multi-tenant application.
Inheritance
Inherited Members
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class MultitenantRoleManager<TRole> : ExtendedRoleManager<TRole>, IDisposable where TRole : class, IMultitenantRole, new()
Type Parameters
TRole
The type encapsulating a role. |
Constructors
MultitenantRoleManager(IMultitenantRoleStore<TRole>, IEnumerable<IRoleValidator<TRole>>, IServiceProvider, ILookupNormalizer, IdentityErrorDescriber, ILogger<MultitenantRoleManager<TRole>>)
Constructs a new instance of ExtendedRoleManager<TRole>.
Declaration
public MultitenantRoleManager(IMultitenantRoleStore<TRole> store, IEnumerable<IRoleValidator<TRole>> roleValidators, IServiceProvider services, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, ILogger<MultitenantRoleManager<TRole>> logger)
Parameters
IMultitenantRoleStore<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<MultitenantRoleManager<TRole>>
logger
The logger used to log messages, warnings and errors. |
Methods
CreateFromTemplateAsync(IRoleTemplate, Nullable<Guid>)
Creates a new role from the specified template
in the persistence store.
Declaration
public override 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. |