UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.IsInRoleAsync Method

Definition

Returns a flag indicating if the specified user is a member of the give normalizedRoleName.

public virtual System.Threading.Tasks.Task<bool> IsInRoleAsync (TUser user, string normalizedRoleName, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<bool> IsInRoleAsync (TUser user, string normalizedRoleName, System.Threading.CancellationToken cancellationToken = default);
abstract member IsInRoleAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.IsInRoleAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.IsInRoleAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Overridable Function IsInRoleAsync (user As TUser, normalizedRoleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)
Public Overrides Function IsInRoleAsync (user As TUser, normalizedRoleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

Parameters

user
TUser

The user whose role membership should be checked.

normalizedRoleName
String

The role to check membership of

cancellationToken
CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

A Task<TResult> containing a flag indicating if the specified user is a member of the given group. If the user is a member of the group the returned value with be true, otherwise it will be false.

Implements

Applies to