语言

AuthorizeAttribute 类

定义

指定此属性应用于的类或方法需要指定的授权。

public ref class AuthorizeAttribute : Attribute, Microsoft::AspNetCore::Authorization::IAuthorizeData
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class AuthorizeAttribute : Attribute, Microsoft.AspNetCore.Authorization.IAuthorizeData
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type AuthorizeAttribute = class
    inherit Attribute
    interface IAuthorizeData
Public Class AuthorizeAttribute
Inherits Attribute
Implements IAuthorizeData
继承
AuthorizeAttribute
属性
实现

构造函数

名称 说明
AuthorizeAttribute()

初始化 AuthorizeAttribute 类的新实例。

AuthorizeAttribute(String)

使用指定的策略初始化类的新实例 AuthorizeAttribute 。

属性

名称 说明
ActiveAuthenticationSchemes
已过时.

获取或设置构造用户信息的方案的逗号分隔列表。

AuthenticationSchemes

获取或设置构造用户信息的方案的逗号分隔列表。

Policy

获取或设置确定对资源的访问权限的策略名称。

Roles

获取或设置允许访问资源的角色的逗号分隔列表。

方法

名称 说明
ToString()

返回一个表示当前属性的字符串。

适用于