SecurityRoleAttribute 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化該類別的新實例 SecurityRoleAttribute 並設定屬性 Role 。
多載
| 名稱 | Description |
|---|---|
| SecurityRoleAttribute(String) |
初始化該類別的新實例 SecurityRoleAttribute 並設定屬性 Role 。 |
| SecurityRoleAttribute(String, Boolean) |
初始化該類別的新實例 SecurityRoleAttribute ,並設定 Role 和 SetEveryoneAccess 屬性。 |
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 ,並設定 Role 和 SetEveryoneAccess 屬性。
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
true要求新建立的角色必須將 Everyone 使用者群組加入為使用者;否則,。 false