ContextUtil::IsSecurityEnabled Property
.NET Framework (current version)
Gets a value that indicates whether role-based security is active in the current context.
Assembly: System.EnterpriseServices (in System.EnterpriseServices.dll)
Property Value
Type: System::Booleantrue if the current context has security enabled; otherwise, false.
| Exception | Condition |
|---|---|
| COMException | There is no COM+ context available. |
The following code example gets the value of a IsSecurityEnabled property.
[SecurityRole("Role1")] public ref class ContextUtil_IsSecurityEnabled: public ServicedComponent { public: void Example() { // Display whether role-based security is active for the current COM+ // context. Console::WriteLine( "Role-based security active in current context: {0}", ContextUtil::IsSecurityEnabled ); } };
.NET Framework
Available since 1.1
Available since 1.1
Show: