ContextUtil.IsSecurityEnabled Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether role-based security is active in the current context.
public:
static property bool IsSecurityEnabled { bool get(); };
C#
public static bool IsSecurityEnabled { get; }
static member IsSecurityEnabled : bool
Public Shared ReadOnly Property IsSecurityEnabled As Boolean
true
if the current context has security enabled; otherwise, false
.
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 );
}
};
C#
[SecurityRole("Role1")]
public class ContextUtil_IsSecurityEnabled : 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);
}
}
<SecurityRole("Role1")> _
Public Class ContextUtil_IsSecurityEnabled
Inherits ServicedComponent
Public Sub Example()
' Display whether role-based security is active for the current COM+
' context.
MsgBox("Role-based security active in current context: " & ContextUtil.IsSecurityEnabled)
End Sub
End Class
Product | Versions |
---|---|
.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 |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: