AuthorizationPolicyBuilder.RequireRole 方法

定义

重载

RequireRole(String[])

RolesAuthorizationRequirement将 添加到当前实例,以强制当前用户必须具有至少一个指定角色。

RequireRole(IEnumerable<String>)

RolesAuthorizationRequirement将 添加到当前实例,以强制当前用户必须具有至少一个指定角色。

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

RolesAuthorizationRequirement将 添加到当前实例,以强制当前用户必须具有至少一个指定角色。

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

参数

roles
String[]

允许的角色。

返回

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

适用于

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

RolesAuthorizationRequirement将 添加到当前实例,以强制当前用户必须具有至少一个指定角色。

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

参数

roles
IEnumerable<String>

允许的角色。

返回

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

适用于