你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

AuthorizeLevelAttribute 类

定义

重要

此 API 不符合 CLS。

将此属性应用于 SignalR Microsoft.AspNet.SignalR.Hub 类或方法来控制对这些类的访问。 根据 AuthorizationLevel 指定的 ,对目标操作的访问将限制为已被授予该级别或更高级别的请求。

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
[System.CLSCompliant(false)]
public class AuthorizeLevelAttribute : Microsoft.AspNet.SignalR.AuthorizeAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
[<System.CLSCompliant(false)>]
type AuthorizeLevelAttribute = class
    inherit AuthorizeAttribute
Public Class AuthorizeLevelAttribute
Inherits AuthorizeAttribute
继承
Microsoft.AspNet.SignalR.AuthorizeAttribute
AuthorizeLevelAttribute
属性

构造函数

AuthorizeLevelAttribute(AuthorizationLevel)

使用给定 levelAuthorizeLevelAttribute 初始化 的新实例。

属性

Level

访问资源所需的最低授权级别。

方法

UserAuthorized(IPrincipal)

将此属性应用于 SignalR Microsoft.AspNet.SignalR.Hub 类或方法来控制对这些类的访问。 根据 AuthorizationLevel 指定的 ,对目标操作的访问将限制为已被授予该级别或更高级别的请求。

适用于