PermissionSetAttribute クラス

定義

宣言型セキュリティを使用して、 PermissionSet のセキュリティ アクションをコードに適用できるようにします。 このクラスは継承できません。

public ref class PermissionSetAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class PermissionSetAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class PermissionSetAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type PermissionSetAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type PermissionSetAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class PermissionSetAttribute
Inherits CodeAccessSecurityAttribute
継承
属性

注釈

Caution

コード アクセス セキュリティ (CAS) は、.NET Framework と .NET のすべてのバージョンで非推奨になりました。 最近のバージョンの .NET では、CAS に関連する API が使用されている場合、CAS 注釈は使用されず、エラーが発生します。 開発者は、セキュリティ タスクを実行するための代替手段を求める必要があります。

PermissionSetAttributeプロパティNameFile、およびXMLは相互に排他的です。つまり、アクセス許可セットは、名前付きアクセス許可セット、アクセス許可セットの XML 表現を含むファイル、またはアクセス許可セットの XML 表現を含む文字列のいずれかをソースとして持つことができます。

許可される宣言のスコープは、使用される SecurityAction によって異なります。 SecurityActionに対して実行されるPermissionSetは、セット内の各アクセス許可に対してそのアクションを実行することと同じです。

セキュリティ属性によって宣言されたセキュリティ情報は、属性ターゲットのメタデータに格納され、実行時にシステムによってアクセスされます。 セキュリティ属性は、宣言型セキュリティにのみ使用されます。 命令型セキュリティの場合は、対応するアクセス許可クラスを使用します。

コンストラクター

名前 説明
PermissionSetAttribute(SecurityAction)

指定したセキュリティ アクションを使用して、 PermissionSetAttribute クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Action

セキュリティ アクションを取得または設定します。

(継承元 SecurityAttribute)
File

宣言するカスタム アクセス許可セットの XML 表現を含むファイルを取得または設定します。

Hex

XML でエンコードされたアクセス許可セットの 16 進数表現を取得または設定します。

Name

アクセス許可セットの名前を取得または設定します。

TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)
UnicodeEncoded

Fileで指定されたファイルが Unicode または ASCII エンコードされているかどうかを示す値を取得または設定します。

Unrestricted

属性によって保護されているリソースに対する完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。

(継承元 SecurityAttribute)
XML

アクセス許可セットの XML 表現を取得または設定します。

メソッド

名前 説明
CreatePermission()

このメソッドは使用されません。

CreatePermissionSet()

このアクセス許可セット属性オブジェクトに基づいて、新しいアクセス許可セットを作成して返します。

Equals(Object)

このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされた場合、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

インターフェイスの型情報を取得するために使用できるオブジェクトの型情報を取得します。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください