Share via


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

AuthorizationRuleAction 値のいずれか 1 つ。

次のコード例は、このプロパティの使用方法を示しています。

 // 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拒否します。 アクセスは既定で許可されます。

適用対象