SecurityPermissionAttribute クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
注意事項
Code Access Security is not supported or honored by the runtime.
注意事項
CAS support is not available with Silverlight applications.
SecurityPermission のセキュリティ アクションを、宣言セキュリティを使用してコードに適用できるようにします。 このクラスは継承できません。
public ref class SecurityPermissionAttribute 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.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class SecurityPermissionAttribute : 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)]
public sealed class SecurityPermissionAttribute : 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 SecurityPermissionAttribute : 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 SecurityPermissionAttribute : 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)]
[System.Obsolete("CAS support is not available with Silverlight applications.")]
public sealed class SecurityPermissionAttribute : 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.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SecurityPermissionAttribute = class
inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SecurityPermissionAttribute = 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>]
type SecurityPermissionAttribute = 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 SecurityPermissionAttribute = 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)>]
[<System.Obsolete("CAS support is not available with Silverlight applications.")>]
type SecurityPermissionAttribute = class
inherit CodeAccessSecurityAttribute
Public NotInheritable Class SecurityPermissionAttribute
Inherits CodeAccessSecurityAttribute
- 継承
- 属性
注釈
注意事項
コード アクセス セキュリティ (CAS) は、.NET Framework と .NET のすべてのバージョンで非推奨になりました。 最近のバージョンの .NET では、CAS 関連の API が使われている場合、CAS の注釈は使われず、エラーが発生します。 開発者は、代わりの手段を見つけてセキュリティ タスクを実現する必要があります。
許可される宣言のスコープは、使用される によって SecurityAction 異なります。
セキュリティ属性によって宣言されたセキュリティ情報は、属性ターゲットのメタデータに格納され、実行時にシステムによってアクセスされます。 セキュリティ属性は、宣言型セキュリティにのみ使用されます。 命令型セキュリティの場合は、対応するアクセス許可クラスを使用します。
クラスを SecurityPermissionAttribute 使用する場合は、要求されているアクセス許可を使用してセキュリティ アクションに従います。 列挙で定義 SecurityPermissionFlag されているように、要求できる各セキュリティ アクセス許可には、 クラスに対応するプロパティがあります SecurityPermissionAttribute 。 たとえば、アンマネージ コードにアクセスする機能を要求するには、要求 SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode=true)
されるプロパティ設定を使用して demand ステートメントに従います。
Note
列挙とSecurityPermissionAttributeプロパティの間の等価性のSecurityPermissionFlag例外は、列挙値が プロパティ (クラスからSecurityAttribute継承) によってUnrestricted表される点AllFlagsです。 すべてのセキュリティ アクセス許可を要求するには、 を指定します Unrestricted=true
。
コンストラクター
SecurityPermissionAttribute(SecurityAction) |
古い.
古い.
SecurityPermissionAttribute を指定して、SecurityAction クラスの新しいインスタンスを初期化します。 |
プロパティ
Action |
古い.
古い.
セキュリティ アクションを取得または設定します。 (継承元 SecurityAttribute) |
Assertion |
古い.
古い.
このコードの呼び出し元すべてに操作に必要なアクセス許可があることをアサートするアクセス許可が宣言されているかどうかを示す値を、取得または設定します。 |
BindingRedirects |
古い.
古い.
アプリケーション構成ファイル内のバインド リダイレクトを実行するためのコードがアクセス許可を持っているかどうかを示す値を取得または設定します。 |
ControlAppDomain |
古い.
古い.
AppDomain を操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
ControlDomainPolicy |
古い.
古い.
ドメイン セキュリティ ポリシーを変更または操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
ControlEvidence |
古い.
古い.
証拠を変更または操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
ControlPolicy |
古い.
古い.
セキュリティ ポリシーを表示して操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
ControlPrincipal |
古い.
古い.
現在のプリンシパルを操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
ControlThread |
古い.
古い.
スレッドを操作するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
Execution |
古い.
古い.
コードを実行するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
Flags |
古い.
古い.
SecurityPermission アクセス許可を構成するすべてのアクセス許可フラグを取得または設定します。 |
Infrastructure |
古い.
古い.
コードがリモート処理コンテキスト シンク、エンボイ シンク、動的シンクの追加など共通言語ランタイム インフラストラクチャにプラグインできるかどうかを示す値を取得または設定します。 |
RemotingConfiguration |
古い.
古い.
コードがリモート処理の型とチャネルを構成できるかどうかを示す値を取得または設定します。 |
SerializationFormatter |
古い.
古い.
コードでシリアル化フォーマッタを使用して、オブジェクトをシリアル化または逆シリアル化できるかどうかを示す値を取得または設定します。 |
SkipVerification |
古い.
古い.
コードの検査を省略するためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
TypeId |
古い.
古い.
派生クラスで実装されると、この Attribute の一意の識別子を取得します。 (継承元 Attribute) |
UnmanagedCode |
古い.
古い.
アンマネージ コードを呼び出すためのアクセス許可が宣言されているかどうかを示す値を取得または設定します。 |
Unrestricted |
古い.
古い.
属性によって保護されているリソースに対して完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。 (継承元 SecurityAttribute) |
メソッド
CreatePermission() |
古い.
古い.
新しい SecurityPermission を作成して返します。 |
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) |
適用対象
こちらもご覧ください
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示