PermissionSet.Intersect(PermissionSet) 方法

定义

创建并返回一个权限集,此权限集为当前的 PermissionSet 和指定 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

参数

other
PermissionSet

与当前的 PermissionSet 相交的权限集。

返回

一个新权限集,它表示当前 PermissionSet 与指定目标的交集。 如果交集为空,则此对象为 null

示例

下面的代码示例演示如何使用 Intersect 方法。 此代码示例是为 PermissionSet 类提供的一个更大示例的一部分。

// 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())

注解

两个权限集的交集是一个权限集,用于描述它们共同描述的操作集。 具体而言,它表示最小权限,以便任何通过这两个权限集的要求也会通过其交集。

对于这两个集中存在的每种类型的权限,这些权限的两个实例使用 权限的 Intersect 方法相交;生成的权限包含在生成的 PermissionSet中。 仅存在于两个集中之一的权限类型将从生成的集中排除。

适用于