This documentation is archived and is not being maintained.

SecurityRoleAttribute Class

Configures a role for an application or component. This class cannot be inherited.

For a list of all members of this type, see SecurityRoleAttribute Members.


[Visual Basic]
<AttributeUsage(AttributeTargets.Assembly Or AttributeTargets.Class _
   Or AttributeTargets.Method Or AttributeTargets.Interface)>
NotInheritable Public Class SecurityRoleAttribute
   Inherits Attribute
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
   | AttributeTargets.Method | AttributeTargets.Interface)]
public sealed class SecurityRoleAttribute : Attribute
[AttributeUsage(AttributeTargets::Assembly |
   AttributeTargets::Class | AttributeTargets::Method |
public __gc __sealed class SecurityRoleAttribute : public
   AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class |
   AttributeTargets.Method | AttributeTargets.Interface)
class SecurityRoleAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


You can use the SecurityRoleAttribute to add roles to an application, and to associate them with components. When SecurityRoleAttribute is applied to an assembly as a whole, it ensures that the role exists in the application configuration (COM+ catalog). You can add members of the role using the COM+ Explorer.

When applied to a component, the SecurityRoleAttribute ensures that the role exists in the application configuration, and associates the target component with the role.

By default, created roles have no members. If the SetEveryoneAccess property is set to true, the Everyone user group is automatically added to the role. This is best for all-access type roles that are given minimal control over the system.

Security roles can be specified at the component level, per interface and per method. As with other method attributes, security configuration is not currently shared between interface definition and method implementation.


Namespace: System.EnterpriseServices

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Enterpriseservices (in System.Enterpriseservices.dll)

See Also

SecurityRoleAttribute Members | System.EnterpriseServices Namespace