November Happy Hour will be moved to Thursday December 5th.

Class VirtualRoleAuthorizationSession

Runtime class to check if a principal is part of a virtual role

Inheritance
System.Object
VirtualRoleAuthorizationSession
Namespace: EPiServer.Security.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class VirtualRoleAuthorizationSession : Object, IVirtualRoleAuthorizationSession
Remarks

Implements a cache for lookups that can be disabled per virtual role using the EnableIsInRoleCache.

Since the class is scoped per request or per thread to get session caching it should never be stored in singleton instances

Constructors

VirtualRoleAuthorizationSession(IVirtualRoleRepository)

Declaration
public VirtualRoleAuthorizationSession(IVirtualRoleRepository repository)
Parameters
Type Name Description
IVirtualRoleRepository repository

Methods

IsInVirtualRole(IPrincipal, String, SecurityEntityType, Object)

Determines whether the current principal belongs to the specified virtual role.

Declaration
public virtual bool IsInVirtualRole(IPrincipal principal, string role, SecurityEntityType type, object context)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal that will be forwarded to the provider

System.String role

The name of the role for which to check membership.

SecurityEntityType type

The security type of the role you want to check

System.Object context

The context under which the query is being performed

Returns
Type Description
System.Boolean

true if the current principal is a member of the specified role; otherwise, false.

Implements

Extension Methods