AuthorizationSection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Web アプリケーションの承認を構成します。 このクラスは継承できません。
public ref class AuthorizationSection sealed : System::Configuration::ConfigurationSection
public sealed class AuthorizationSection : System.Configuration.ConfigurationSection
type AuthorizationSection = class
inherit ConfigurationSection
Public NotInheritable Class AuthorizationSection
Inherits ConfigurationSection
- 継承
例
次のコード例は、既存の Web アプリケーションの AuthorizationSection 構成ファイルから オブジェクトを取得する方法を示しています。 このオブジェクトを使用して、そのメンバーにアクセスできます。 構成ファイルには、次のようなセットアップが含まれます。
注意
セクションを使用する credentials
場合は、「 ASP.NET 認証」で説明されているガイドラインに従ってください。 スケーラビリティとセキュリティ機能を向上させるために、外部データベースを使用してユーザーの資格情報を格納することをお勧めします。 セキュリティで保護された ASP.NET アプリケーションの構築の詳細については、「 ASP.NET アプリケーションのセキュリティ保護 」および「 セキュリティで保護された ASP.NET アプリケーションの構築: 認証、承認、およびセキュリティで保護された通信」を参照してください。
<authorization>
<allow users="userName" roles="admin" verbs="post" />
<deny users="*" verbs="post"/>
</authorization>
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
// Get the section.
AuthorizationSection authorizationSection =
(AuthorizationSection)configuration.GetSection(
"system.web/authorization");
' Get the section.
Dim authorizationSection _
As AuthorizationSection = _
CType(configuration.GetSection( _
"system.web/authorization"), AuthorizationSection)
注釈
AuthorizationSection クラスを使用すると、構成ファイルの authorization
セクションにプログラムからアクセスして変更できます。
この型は、および 型をAuthorizationRuleAuthorizationRuleCollection含むグループのAuthorizationRuleAction一部です。
注意
はAuthorizationSection、値Everywhereが である section プロパティAllowDefinitionに従って、構成ファイルの関連セクションとの間で情報の読み取りと書き込みを行うことができます。
コンストラクター
AuthorizationSection() |
既定の設定を使用して AuthorizationSection クラスの新しいインスタンスを初期化します。 |