次の方法で共有


PermissionSet.Intersect メソッド

現在の PermissionSet と指定した PermissionSet の積集合を表すアクセス許可を作成し、返します。

Public Overridable Function Intersect( _
   ByVal other As PermissionSet _) As PermissionSet
[C#]
public virtual PermissionSet Intersect(PermissionSetother);
[C++]
public: virtual PermissionSet* Intersect(PermissionSet* other);
[JScript]
public function Intersect(
   other : PermissionSet) : PermissionSet;

パラメータ

  • other
    現在の PermissionSet との積集合を持つ PermissionSet

戻り値

現在の PermissionSet と指定したターゲットの積集合を表す新しい PermissionSet 。積集合が空である場合、このオブジェクトは null 参照 (Visual Basic では Nothing) です。

解説

2 つのアクセス許可セットの積集合となるアクセス許可セットには、両方に共通する操作のセットが記述されています。つまり、両方のアクセス許可セットに適合する要求がそれぞれの積集合にも適合する、最小のアクセス許可を表します。

2 つのセット内に存在するそれぞれのアクセス許可の種類については、アクセス許可の 2 つのインスタンスが、そのアクセス許可の Intersect メソッドを使用して積集合になり、結果アクセス許可が結果 PermissionSet に含まれます。2 つのセットのうちの 1 つだけにあるアクセス許可の種類は、結果セットから除外されます。

使用例

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

[C#] 
// 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());

[C++] 
// Display the intersection of two permission sets.
PermissionSet*  ps3 = ps2->Intersect(ps1);
Console::WriteLine(
   S"The intersection of the first permission set and the second permission set = {0}",
   ps3);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

PermissionSet クラス | PermissionSet メンバ | System.Security 名前空間