AuthorizationPolicyBuilder.RequireUserName(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.