AuthorizationRule 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 AuthorizationRule 클래스를 사용하면 프로그래밍 방식으로 구성 파일의 섹션에 액세스하고 수정할 authorization 수 있습니다. 이 클래스는 상속할 수 없습니다.
public ref class AuthorizationRule sealed : System::Configuration::ConfigurationElement
public sealed class AuthorizationRule : System.Configuration.ConfigurationElement
type AuthorizationRule = class
inherit ConfigurationElement
Public NotInheritable Class AuthorizationRule
Inherits ConfigurationElement
- 상속
예제
다음 코드 예제에서는 .를 사용하는 방법을 보여 줍니다 AuthorizationRule.
메모
credentials 섹션을 사용하는 경우 ASP.NET 인증 설명된 지침을 따라야 합니다. 확장성과 향상된 보안 기능을 위해 외부 데이터베이스를 사용하여 사용자의 자격 증명을 저장하는 것이 좋습니다. 보안 ASP.NET 애플리케이션을 빌드하는 방법에 대한 자세한 내용은 ASP.NET 애플리케이션 보안 및 보안 ASP.NET 애플리케이션 빌드: 인증, 권한 부여 및 보안 통신을 참조하세요.
// 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)
// 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)
설명
클래스는 AuthorizationRule 프로그래밍 방식으로 액세스 하 고 구성 파일의 섹션을 authorization 수정 하는 방법을 제공 합니다.
이 형식은 , 및 형식을 AuthorizationSectionAuthorizationRuleCollectionAuthorizationRuleAction 포함하는 그룹의 일부입니다.
메모
AuthorizationSection 구성 계층 구조의 모든 수준에서 구성 정보를 업데이트할 수 있습니다.
생성자
| Name | Description |
|---|---|
| AuthorizationRule(AuthorizationRuleAction) |
전달된 개체를 AuthorizationRule 사용하여 클래스의 새 인스턴스를 만듭니다. |