Try our conversational search powered by Generative AI!

Class VirtualRoleProviderBase

Base class required to implement virtual roles

Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
public abstract class VirtualRoleProviderBase

Constructors

VirtualRoleProviderBase()

Initializes a new instance of the VirtualRoleProviderBase class.

Declaration
protected VirtualRoleProviderBase()

Properties

EnableIsInRoleCache

Determines if the response from IsInRole is allowed to cached per request (enabled by default)

Declaration
public bool EnableIsInRoleCache { get; protected set; }
Property Value
Type Description
System.Boolean
Remarks

The response from the first call to IsInRole will be cached per request or thread if no request is available

Name

Gets or sets the name of the Virtual Role

Declaration
public virtual string Name { get; set; }
Property Value
Type Description
System.String

SecurityEntityType

The security entity type is primarily used when checking role membership for page access rights

Declaration
public SecurityEntityType SecurityEntityType { get; protected set; }
Property Value
Type Description
SecurityEntityType
Remarks

You should use SecurityEntityType.Role to be part of the normal role checking in ASP.NET

SupportsClaims

Determines if the response from IsInRole can be added as a Role claim

Declaration
public bool SupportsClaims { get; protected set; }
Property Value
Type Description
System.Boolean
Remarks

Claims are only added when the 'addClaims' configuration setting has been enabled on the 'virtualRoles' element.

Methods

Initialize(String, NameValueCollection)

Initializes the provider.

Declaration
public virtual void Initialize(string name, NameValueCollection config)
Parameters
Type Name Description
System.String name

The friendly name of the provider.

System.Collections.Specialized.NameValueCollection config

A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.

IsInVirtualRole(IPrincipal, Object)

Determines whether the specified principal is a member of this role.

Declaration
public abstract bool IsInVirtualRole(IPrincipal principal, object context)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.Object context

External context.

Returns
Type Description
System.Boolean

true if the specified principal is in the virtual role; otherwise, false.

Remarks

The context parameter may be null but can be used to transfer external context to a Virtual role provider

Extension Methods