AuthorizationPolicyBuilder.RequireUserName(String) 方法

定义

NameAuthorizationRequirement将 添加到当前 实例,以强制当前用户与指定名称匹配。

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

参数

userName
String

当前用户必须具有的用户名。

返回

完成操作后对此实例的引用。

适用于