PermissionSet.IsSubsetOf(PermissionSet) メソッド

定義

現在の PermissionSet が指定した PermissionSet のサブセットであるかどうかを判断します。Determines whether the current PermissionSet is a subset of the specified PermissionSet.

public:
 bool IsSubsetOf(System::Security::PermissionSet ^ target);
public:
 virtual bool IsSubsetOf(System::Security::PermissionSet ^ target);
public bool IsSubsetOf (System.Security.PermissionSet target);
public virtual bool IsSubsetOf (System.Security.PermissionSet target);
member this.IsSubsetOf : System.Security.PermissionSet -> bool
abstract member IsSubsetOf : System.Security.PermissionSet -> bool
override this.IsSubsetOf : System.Security.PermissionSet -> bool
Public Function IsSubsetOf (target As PermissionSet) As Boolean
Public Overridable Function IsSubsetOf (target As PermissionSet) As Boolean

パラメーター

target
PermissionSet

サブセットの関係をテストするためのアクセス許可セット。The permission set to test for the subset relationship. これは PermissionSetNamedPermissionSet のいずれかである必要があります。This must be either a PermissionSet or a NamedPermissionSet.

戻り値

現在の truePermissionSet パラメーターのサブセットである場合は target。それ以外の場合は falsetrue if the current PermissionSet is a subset of the target parameter; otherwise, false.

次のコード例は、IsSubsetOf メソッドの使用方法を示しています。The following code example shows the use of the IsSubsetOf method. このコード例は、PermissionSet クラス用に用意されている大規模な例の一部です。This code example is part of a larger example provided for the PermissionSet class.

// Create a second permission set and compare it to the first permission set.
ps2->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"USERNAME" ) );
ps2->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Write,"COMPUTERNAME" ) );
IEnumerator^ list =  ps1->GetEnumerator();
Console::WriteLine("Permissions in first permission set:");
      while (list->MoveNext())
          Console::WriteLine(list->Current->ToString());
Console::WriteLine( "Second permission IsSubsetOf first permission = {0}", ps2->IsSubsetOf( ps1 ) );
// Create a second permission set and compare it to the first permission set.
ps2.AddPermission(
    new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"));
ps2.AddPermission(
    new EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME"));
IEnumerator list =  ps1.GetEnumerator();
Console.WriteLine("Permissions in first permission set:");
while (list.MoveNext())
    Console.WriteLine(list.Current.ToString());
Console.WriteLine("Second permission IsSubsetOf first permission = " + ps2.IsSubsetOf(ps1));
' Create a second permission set and compare it to the first permission set.
ps2.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"))
ps2.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME"))
Console.WriteLine("Permissions in first permission set:")
Dim list As IEnumerator = ps1.GetEnumerator()
While list.MoveNext()
    Console.WriteLine(list.Current.ToString())
End While
Console.WriteLine("Second permission IsSubsetOf first permission = " & ps2.IsSubsetOf(ps1))

注釈

PermissionSet はターゲット PermissionSet のサブセットであり、PermissionSet で成功したすべての要求がターゲットでも成功した場合に使用されます。A PermissionSet is a subset of the target PermissionSet if all demands that succeed for the PermissionSet also succeed for the target. つまり、ターゲットには、少なくともサブセットに含まれるアクセス許可が含まれています。That is, the target contains at least the permissions contained in the subset.

適用対象