PermissionSet.Intersect(PermissionSet) Metoda

Definicja

Tworzy i zwraca zestaw uprawnień, który jest przecięciem bieżącego PermissionSet i określonego PermissionSet.

public:
 System::Security::PermissionSet ^ Intersect(System::Security::PermissionSet ^ other);
public:
 virtual System::Security::PermissionSet ^ Intersect(System::Security::PermissionSet ^ other);
public System.Security.PermissionSet Intersect (System.Security.PermissionSet other);
public System.Security.PermissionSet? Intersect (System.Security.PermissionSet? other);
public virtual System.Security.PermissionSet Intersect (System.Security.PermissionSet other);
member this.Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
abstract member Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
override this.Intersect : System.Security.PermissionSet -> System.Security.PermissionSet
Public Function Intersect (other As PermissionSet) As PermissionSet
Public Overridable Function Intersect (other As PermissionSet) As PermissionSet

Parametry

other
PermissionSet

Uprawnienie ustawione na przecięcie z bieżącym PermissionSetelementem .

Zwraca

PermissionSet

Nowy zestaw uprawnień reprezentujący przecięcie bieżącego PermissionSet i określonego obiektu docelowego. Ten obiekt jest wtedy null , gdy przecięcie jest puste.

Przykłady

Poniższy przykład kodu przedstawia użycie Intersect metody . Ten przykład kodu jest częścią większego przykładu podanego PermissionSet dla klasy.

// Display the intersection of two permission sets.
PermissionSet^ ps3 = ps2->Intersect( ps1 );
Console::WriteLine( "The intersection of the first permission set and the second permission set = {0}", ps3 );
// Display the intersection of two permission sets.
PermissionSet ps3 = ps2.Intersect(ps1);
Console.WriteLine("The intersection of the first permission set and "
    + "the second permission set = " + ps3.ToString());
' Display the intersection of two permission sets.
Dim ps3 As PermissionSet = ps2.Intersect(ps1)
Console.WriteLine("The intersection of the first permission set and " & "the second permission set = " & ps3.ToString())

Uwagi

Przecięcie dwóch zestawów uprawnień to zestaw uprawnień, który opisuje zestaw operacji, które opisują wspólne. W szczególności reprezentuje minimalne uprawnienia, takie jak każde zapotrzebowanie, które przekazuje oba zestawy uprawnień, również przechodzi ich skrzyżowanie.

Dla każdego typu uprawnień, które znajdują się w obu zestawach, dwa wystąpienia tych uprawnień są przecinane za pomocą metody uprawnień Intersect ; wynikowe uprawnienie jest uwzględniane w wynikowym PermissionSet. Typy uprawnień, które istnieją tylko w jednym z dwóch zestawów, są wykluczone z wynikowego zestawu.

Dotyczy