AuthorizationRule.Action 속성

정의

작업을 가져오거나 설정합니다 AuthorizationRule .

public:
 property System::Web::Configuration::AuthorizationRuleAction Action { System::Web::Configuration::AuthorizationRuleAction get(); void set(System::Web::Configuration::AuthorizationRuleAction value); };
public System.Web.Configuration.AuthorizationRuleAction Action { get; set; }
member this.Action : System.Web.Configuration.AuthorizationRuleAction with get, set
Public Property Action As AuthorizationRuleAction

속성 값

값 중 AuthorizationRuleAction 하나입니다.

예제

다음 코드 예제에서는이 속성을 사용 하는 방법을 보여 있습니다.

 // Using the AuthorizationRuleCollection Add method.

 // Set the action property.
 authorizationRule.Action = 
    AuthorizationRuleAction.Allow;
 // Define the new rule to add to the collection.
 authorizationRule.Users.Add("userName");
 authorizationRule.Roles.Add("admin");
 authorizationRule.Verbs.Add("POST");

 // Add the new rule to the collection.
 authorizationSection.Rules.Add(authorizationRule);
' Using the AuthorizationRuleCollection Add method.
' Set the action property.
  authorizationRule.Action = _
  AuthorizationRuleAction.Allow
' Define the new rule to add to the collection.
authorizationRule.Users.Add("userName")
authorizationRule.Roles.Add("admin")
authorizationRule.Verbs.Add("POST")

' Add the new rule to the collection.
authorizationSection.Rules.Add(authorizationRule)

설명

런타임에 권한 부여 모듈 allow 은 특정 사용자에게 맞는 첫 번째 액세스 규칙을 찾을 때까지 반복 및 deny 요소를 반복합니다. 그런 다음 첫 번째 액세스 규칙이 있는지 allow 여부에 따라 URL 리소스에 대한 액세스 권한을 부여하거나 deny거부합니다. 액세스는 기본적으로 허용됩니다.

적용 대상