DataProtectionPermission.IsSubsetOf(IPermission) 메서드

정의

현재 사용 권한이 지정된 사용 권한의 하위 집합인지를 확인합니다.

public:
 override bool IsSubsetOf(System::Security::IPermission ^ target);
public override bool IsSubsetOf (System.Security.IPermission target);
override this.IsSubsetOf : System.Security.IPermission -> bool
Public Overrides Function IsSubsetOf (target As IPermission) As Boolean

매개 변수

target
IPermission

하위 집합 관계를 테스트하는 사용 권한입니다. 이 사용 권한은 현재 권한과 동일한 형식이어야 합니다.

반환

Boolean

현재 사용 권한이 지정된 사용 권한의 하위 집합이면 true이고, 그렇지 않으면 false입니다.

예외

targetnull 가 아니며 현재 사용 권한과 동일한 유형의 사용 권한을 지정하지 않습니다.

예제

다음 코드 예제에서는 메서드의 사용을 보여 있습니다 IsSubsetOf . 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataProtectionPermission 클래스입니다.

참고

코드 예제는 메서드의 사용을 보여 주는 것이 아니라 메서드의 동작을 표시하기 위한 것입니다. 으로 보안 인프라를 권한 클래스의 메서드를 사용 하는 일반적으로 애플리케이션에서 사용 되지 됩니다.

bool rc = sp2->IsSubsetOf( sp3 );
Console::WriteLine( "Is the permission with all flags set (AllFlags) "
"a subset of \n \tthe permission with an Unrestricted "
"permission state? {0}", (rc ? (String^)"Yes" : "No") );
rc = sp1->IsSubsetOf( sp2 );
Console::WriteLine( "Is the permission with ProtectData access a "
"subset of the permission with \n"
"\tAllFlags set? {0}", (rc ? (String^)"Yes" : "No") );
bool rc = sp2.IsSubsetOf(sp3);
Console.WriteLine("Is the permission with all flags set (AllFlags) " +
    "a subset of \n \tthe permission with an Unrestricted " +
    "permission state? " + (rc ? "Yes" : "No"));
rc = sp1.IsSubsetOf(sp2);
Console.WriteLine("Is the permission with ProtectData access a " +
    "subset of the permission with \n" + "\tAllFlags set? " +
    (rc ? "Yes" : "No"));
Dim rc As Boolean = sp2.IsSubsetOf(sp3)
Console.WriteLine("Is the permission with all flags set (AllFlags) " + "a subset of " + vbLf + " " + vbTab + "the permission with an Unrestricted " + "permission state? " + IIf(rc, "Yes", "No")) 'TODO: For performance reasons this should be changed to nested IF statements
rc = sp1.IsSubsetOf(sp2)
Console.WriteLine("Is the permission with ProtectData access a " + "subset of the permission with " + vbLf + vbTab + "AllFlags set? " + IIf(rc, "Yes", "No")) 'TODO: For performance reasons this should be changed to nested IF statements

설명

현재 사용 권한이 지정된 사용 권한에 완전히 포함된 작업 집합을 지정하는 경우 현재 권한은 지정된 사용 권한의 하위 집합입니다. 예를 들어 액세스 권한 ProtectData 은 액세스 권한 AllFlags 의 하위 집합입니다.

적용 대상