AuthorizationRule クラス
アセンブリ: mscorlib (mscorlib.dll 内)


System.Security.AccessControl.AuthorizationRule
System.Security.AccessControl.AccessRule
System.Security.AccessControl.AuditRule


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


AuthorizationRule クラス
アセンブリ: System.Web (system.web.dll 内)


AuthorizationRule クラスを使用すると、構成ファイルの authorization セクションにプログラムからアクセスして変更できます。
この型は、AuthorizationSection 型、AuthorizationRuleCollection 型、AuthorizationRuleAction 型を含むグループの一部です。
![]() |
---|

AuthorizationRule を使用する方法を次のコード例に示します。
![]() |
---|
credentials セクションを使用する場合は、「ASP.NET の認証」に説明されているガイドラインに従う必要があります。スケーラビリティとセキュリティ機能を高めるため、外部のデータベースを使用して、ユーザーの資格情報を保管することをお勧めします。安全な ASP.NET アプリケーションを構築する方法の詳細については、Microsoft MSDN Web サイト (msdn.microsoft.com) で、「Securing Your ASP.NET Application」や「Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication」を参照してください。 |
' Create an authorization rule object. Dim action As AuthorizationRuleAction = _ AuthorizationRuleAction.Deny Dim authorizationRule = _ New System.Web.Configuration.AuthorizationRule(action)
// Create an authorization rule object. AuthorizationRuleAction action = AuthorizationRuleAction.Deny; AuthorizationRule authorizationRule = new System.Web.Configuration.AuthorizationRule(action);
' 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);

System.Configuration.ConfigurationElement
System.Web.Configuration.AuthorizationRule


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- AuthorizationRule クラスのページへのリンク