AuthorizationPolicyBuilder.RequireRole Method

Definition

Overloads

RequireRole(String[])

Adds a RolesAuthorizationRequirement to the current instance which enforces that the current user must have at least one of the specified roles.

RequireRole(IEnumerable<String>)

Adds a RolesAuthorizationRequirement to the current instance which enforces that the current user must have at least one of the specified roles.

RequireRole(String[])

Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs

Adds a RolesAuthorizationRequirement to the current instance which enforces that the current user must have at least one of the specified roles.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireRole(... cli::array <System::String ^> ^ roles);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireRole (params string[] roles);
member this.RequireRole : string[] -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireRole (ParamArray roles As String()) As AuthorizationPolicyBuilder

Parameters

roles
String[]

The allowed roles.

Returns

A reference to this instance after the operation has completed.

Applies to

RequireRole(IEnumerable<String>)

Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs

Adds a RolesAuthorizationRequirement to the current instance which enforces that the current user must have at least one of the specified roles.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireRole(System::Collections::Generic::IEnumerable<System::String ^> ^ roles);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireRole (System.Collections.Generic.IEnumerable<string> roles);
member this.RequireRole : seq<string> -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireRole (roles As IEnumerable(Of String)) As AuthorizationPolicyBuilder

Parameters

roles
IEnumerable<String>

The allowed roles.

Returns

A reference to this instance after the operation has completed.

Applies to