SecurityRoleAttribute クラス

定義

アプリケーションまたはコンポーネントのロールを構成します。 このクラスは継承できません。

public ref class SecurityRoleAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class SecurityRoleAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
[<System.Runtime.InteropServices.ComVisible(false)>]
type SecurityRoleAttribute = class
    inherit Attribute
Public NotInheritable Class SecurityRoleAttribute
Inherits Attribute
継承
SecurityRoleAttribute
属性

次のコード例では、この属性を使用して、ロールをクラスを含むアセンブリに関連付ける方法を ServicedComponent 示します。

// Create a security role for the component.
[assembly:SecurityRole("Manager")];
// Create a security role for the component.
[assembly: SecurityRole("Manager")]
' Create a security role for the component.
<Assembly: SecurityRole("Manager")>

注釈

SecurityRoleAttribute 使用して、アプリケーションにロールを追加し、それらをコンポーネントに関連付けることができます。 SecurityRoleAttributeがアセンブリ全体に適用されると、ロールがアプリケーション構成 (COM+ カタログ) に確実に存在します。 ロールのメンバーは、COM+ エクスプローラーを使用して追加できます。

コンポーネントに適用すると、 によって SecurityRoleAttribute 、アプリケーション構成にロールが確実に存在し、ターゲット コンポーネントがロールに関連付けられます。

既定では、作成されたロールにはメンバーがありません。 プロパティが SetEveryoneAccesstrue設定されている場合、Everyone ユーザー グループがロールに自動的に追加されます。 これは、システムを最小限に制御できる、すべてのアクセスの種類のロールに最適です。

セキュリティ ロールは、コンポーネント レベルで、インターフェイスごと、メソッドごとに指定できます。 他のメソッド属性と同様に、セキュリティ構成は現在、インターフェイス定義とメソッド実装の間で共有されていません。

コンストラクター

SecurityRoleAttribute(String)

SecurityRoleAttribute クラスの新しいインスタンスを初期化し、Role プロパティを設定します。

SecurityRoleAttribute(String, Boolean)

SecurityRoleAttribute クラスの新しいインスタンスを初期化し、Role プロパティと SetEveryoneAccess プロパティを設定します。

プロパティ

Description

ロールの説明を取得または設定します。

Role

セキュリティ ロールを取得または設定します。

SetEveryoneAccess

Everyone ユーザー グループをユーザーとして追加するかどうかを示す値を設定します。

TypeId

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

(継承元 Attribute)

メソッド

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)

適用対象