SecurityRoleAttribute Constructors

Definition

Initializes a new instance of the SecurityRoleAttribute class and sets the Role property.

Overloads

SecurityRoleAttribute(String)

Initializes a new instance of the SecurityRoleAttribute class and sets the Role property.

SecurityRoleAttribute(String, Boolean)

Initializes a new instance of the SecurityRoleAttribute class and sets the Role and SetEveryoneAccess properties.

SecurityRoleAttribute(String)

Initializes a new instance of the SecurityRoleAttribute class and sets the Role property.

C#
public SecurityRoleAttribute(string role);

Parameters

role
String

A security role for the application, component, interface, or method.

Examples

The following code example demonstrates the use of this attribute to associate a role with an assembly that contains ServicedComponent classes.

C#
// Create a security role for the component.
[assembly: SecurityRole("Manager")]

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SecurityRoleAttribute(String, Boolean)

Initializes a new instance of the SecurityRoleAttribute class and sets the Role and SetEveryoneAccess properties.

C#
public SecurityRoleAttribute(string role, bool everyone);

Parameters

role
String

A security role for the application, component, interface, or method.

everyone
Boolean

true to require that the newly created role have the Everyone user group added as a user; otherwise, false.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1