SecurityRoleAttribute 建構函式

定義

初始化 SecurityRoleAttribute 類別的新執行個體,並且設定 Role 屬性。

多載

SecurityRoleAttribute(String)

初始化 SecurityRoleAttribute 類別的新執行個體,並且設定 Role 屬性。

SecurityRoleAttribute(String, Boolean)

初始化 SecurityRoleAttribute 類別的新執行個體,並設定 RoleSetEveryoneAccess 屬性。

SecurityRoleAttribute(String)

初始化 SecurityRoleAttribute 類別的新執行個體,並且設定 Role 屬性。

public:
 SecurityRoleAttribute(System::String ^ role);
public SecurityRoleAttribute (string role);
new System.EnterpriseServices.SecurityRoleAttribute : string -> System.EnterpriseServices.SecurityRoleAttribute
Public Sub New (role As String)

參數

role
String

應用程式、元件、介面或方法的安全性角色。

範例

下列程式代碼範例示範如何使用這個屬性,將角色與包含類別的 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(String, Boolean)

初始化 SecurityRoleAttribute 類別的新執行個體,並設定 RoleSetEveryoneAccess 屬性。

public:
 SecurityRoleAttribute(System::String ^ role, bool everyone);
public SecurityRoleAttribute (string role, bool everyone);
new System.EnterpriseServices.SecurityRoleAttribute : string * bool -> System.EnterpriseServices.SecurityRoleAttribute
Public Sub New (role As String, everyone As Boolean)

參數

role
String

應用程式、元件、介面或方法的安全性角色。

everyone
Boolean

若需要新建立的角色將 Everyone 使用者群組當做使用者加入,則為 true,否則為 false

適用於