Class VirtualRoleAuthorizationSession
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Runtime class to check if a principal is part of a virtual role
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Security.Internal
Assembly: EPiServer.Framework.dll
Version: 10.10.4Syntax
[ServiceConfiguration(typeof(IVirtualRoleAuthorizationSession), Lifecycle = ServiceInstanceScope.Hybrid)]
public class VirtualRoleAuthorizationSession : 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)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.
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. |