PermissionSet.IsSubsetOf(PermissionSet) PermissionSet.IsSubsetOf(PermissionSet) PermissionSet.IsSubsetOf(PermissionSet) PermissionSet.IsSubsetOf(PermissionSet) Method

Definition

Überprüft, ob der aktuelle PermissionSet einer Teilmenge des angegebenen PermissionSet entspricht.Determines whether the current PermissionSet is a subset of the specified PermissionSet.

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

Parameter

target
PermissionSet PermissionSet PermissionSet PermissionSet

Der für die Teilmengenbeziehung zu testende Berechtigungssatz.The permission set to test for the subset relationship. Dieser muss entweder PermissionSet oder NamedPermissionSet sein.This must be either a PermissionSet or a NamedPermissionSet.

Gibt zurück

true, wenn der aktuelle PermissionSet eine Teilmenge des target-Parameters ist, andernfalls false.true if the current PermissionSet is a subset of the target parameter; otherwise, false.

Beispiele

Im folgenden Codebeispiel wird die Verwendung IsSubsetOf der-Methode veranschaulicht.The following code example shows the use of the IsSubsetOf method. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die PermissionSet -Klasse bereitgestellt wird.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))

Hinweise

Eine PermissionSet ist eine Teilmenge des Ziels PermissionSet , wenn alle PermissionSet Anforderungen, die für erfolgreich sind, auch für das Ziel erfolgreich sind.A PermissionSet is a subset of the target PermissionSet if all demands that succeed for the PermissionSet also succeed for the target. Das heißt, das Ziel enthält mindestens die Berechtigungen, die in der Teilmenge enthalten sind.That is, the target contains at least the permissions contained in the subset.

Gilt für: