Dela via


AuthorizationPolicyBuilder.RequireUserName(String) Method

Definition

Adds a NameAuthorizationRequirement to the current instance which enforces that the current user matches the specified name.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireUserName(System::String ^ userName);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireUserName (string userName);
member this.RequireUserName : string -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireUserName (userName As String) As AuthorizationPolicyBuilder

Parameters

userName
String

The user name the current user must have.

Returns

A reference to this instance after the operation has completed.

Applies to