Class VirtualPathProviderSecurityManagement

Security descriptor implementing access checks for write (Create|Edit) and Delete by validating that a specified principal is member of a group configured for that permission.

Inheritance
System.Object
VirtualPathProviderSecurityManagement
Implements
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.Web.Hosting
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class VirtualPathProviderSecurityManagement : ISecurityDescriptor

Constructors

VirtualPathProviderSecurityManagement(NameValueCollection)

Initializes a new instance of the VirtualPathProviderSecurityManagement class by adding access level information for the groups provided in the configuration.

Declaration
public VirtualPathProviderSecurityManagement(NameValueCollection configParameters)
Parameters
Type Name Description
System.Collections.Specialized.NameValueCollection configParameters

A collection of parameters for configuration of this security descriptor.

Remarks

Configures write access to the comma-separated list of groups defined in the WriteAccess configuration property and delete access to the groups defined in the DeleteAccess proerty.

Fields

accessLevels

The access levels for the native provider.

Declaration
protected Dictionary<string, AccessLevel> accessLevels
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, AccessLevel>

Methods

GetAccessLevel(IPrincipal)

Returns the access level for the specified principal.

Declaration
public AccessLevel GetAccessLevel(IPrincipal principal)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal to check access against.

Returns
Type Description
AccessLevel

The access level.

Remarks

Use this method when you want to get the union of all access types granted to this principal. This is most likely only used for display purposes in the user interface. Code that checks access and performs different actions depending on the type of access granted should use the HasAccess method, since it does what you want and has the potential for being much faster.

HasAccess(IPrincipal, AccessLevel)

Determines whether the specified principal has the requested access.

Declaration
public bool HasAccess(IPrincipal principal, AccessLevel access)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal to authorize.

AccessLevel access

The requested access level.

Returns
Type Description
System.Boolean

true if the specified principal has access; otherwise, false.

Remarks

Note that the access level is a bitmask, i e we simply check that all specified access types are granted to the principal.

Implements

Extension Methods