PermissionSet.Demand 메서드

정의

호출 스택의 상위 호출자에게 현재 인스턴스로 지정된 권한이 없는 경우 런타임에 SecurityException 을 강제 적용합니다.

public:
 virtual void Demand();
public void Demand ();
public virtual void Demand ();
abstract member Demand : unit -> unit
override this.Demand : unit -> unit
Public Sub Demand ()
Public Overridable Sub Demand ()

구현

예외

호출 체인의 호출자에게 요구된 사용 권한이 없습니다.

예제

다음 코드 예제에서는 사용 권한 집합의 Demand 모든 권한을 요구 하는 메서드의 사용을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 PermissionSet 클래스입니다.

// Demand all the permissions in the set.
Console::WriteLine( "Demand all permissions." );
ps1->Demand();
// Demand all the permissions in the set.
Console.WriteLine("Demand all permissions.");
ps1.Demand();
' Demand all the permissions in the set.
Console.WriteLine("Demand all permissions.")
ps1.Demand()

설명

모든 PermissionSet 호출자가 하나의 작업으로 집합의 모든 사용 권한을 갖도록 하는 데 사용합니다Demand.

이 메서드를 호출 하는 코드의 사용 권한은 검사 하지 않습니다. 확인 코드의 직접 실행 호출자에서 시작 하 고 스택을 나아갑니다. 호출 스택의 메서드 호출 스택의 상위에 메서드를 호출 낮은 호출 스택의 있도록에 일반적으로 하향식으로 표시 됩니다. Demand 는 throw되지 않는 SecurityException 경우에만 성공합니다.

PermissionSet 상속 CodeAccessPermissionDemand 되지 않는 사용 권한이 포함된 경우 해당 사용 권한의 메서드도 호출됩니다.

적용 대상