Gets or sets a value indicating whether IsInRole on VirtualRolePrincipal may throw an exception.

Namespace:  EPiServer.Configuration
Assembly:  EPiServer.Configuration (in EPiServer.Configuration.dll) Version: 5.2.375.236


[ConfigurationPropertyAttribute("failSafeIsInRole", DefaultValue = false, IsRequired = false)]
public bool FailSafeIsInRole { get; set; }

Field Value

true if IsInRole is fail safe (cannot throw exception); otherwise, false.


This setting can be useful to emulate the behavior of IsInRole as it worked in .NET Framework 1.0 / 1.1 In these versions any exceptions thrown by code executing beneath IsInRole were caught and ignored. The IsInRole for a WindowsPrincipal in .NET 2.0 may throw an exception if a domain controller is unavailable - this may be undesired behavior since it could prevent the logon process, thus preventing any user from logging on. By setting this property to True you will cause any exceptions thrown by IsInRole to be caught and ignored. The IsInRole call will be interpreted as returning False on throw.

See Also