AuthorizationRuleAction 枚举

定义

指定访问资源时应用的授权类型。Specifies the type of authorization to apply when accessing a resource.

public enum class AuthorizationRuleAction
public enum AuthorizationRuleAction
type AuthorizationRuleAction = 
Public Enum AuthorizationRuleAction
继承
AuthorizationRuleAction

字段

Allow 1

授权类型允许对资源进行访问。The authorization type allows access to the resource.

Deny 0

授权类型拒绝对资源进行访问。The authorization type denies access to the resource.

示例

下面的代码示例演示如何使用Action属性。The following code example shows how use the Action property. 此代码示例是为AuthorizationRule类提供的更大示例的一部分。This code example is part of a larger example provided for the AuthorizationRule class.

// Create an authorization rule object.
AuthorizationRuleAction action =
    AuthorizationRuleAction.Deny;
AuthorizationRule authorizationRule = 
    new System.Web.Configuration.AuthorizationRule(action);
' Create an authorization rule object.
  Dim action As AuthorizationRuleAction = _
  AuthorizationRuleAction.Deny
  Dim authorizationRule = _
  New System.Web.Configuration.AuthorizationRule(action)

注解

Action使用属性以编程方式配置 Web 应用程序要使用的授权操作。Use the Action property to programmatically configure the authorization action to be used by a Web application.

适用于

另请参阅