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

Class FilterAccess

Filter pages for the current user based on a required access level

Inheritance
System.Object
FilterAccess
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.Filters
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
public class FilterAccess : PageFilterBase, IPageFilter, IContentFilter

Constructors

FilterAccess()

Initializes a new instance of the FilterAccess class.

Declaration
public FilterAccess()
Remarks

Will default to AccessLevel.Read, i e the current user must have at least read access to the page otherwise it will be removed from the list.

FilterAccess(AccessLevel)

Initializes a new instance of the FilterAccess class.

Declaration
public FilterAccess(AccessLevel requiredAccess)
Parameters
Type Name Description
AccessLevel requiredAccess

The required access level.

Properties

RequiredAccess

Gets or sets the required access level.

Declaration
public AccessLevel RequiredAccess { get; set; }
Property Value
Type Description
AccessLevel

The required access.

SimpleFilter

A simple filter only checks explicit access rights and ignores published state

Declaration
public bool SimpleFilter { get; set; }
Property Value
Type Description
System.Boolean

True to enable simple filtering, default is false

Methods

QueryDistinctAccessEdit(IContent, AccessLevel)

Return the distinct access level that the current user has to this content.

Declaration
public static bool QueryDistinctAccessEdit(IContent content, AccessLevel requestedLevel)
Parameters
Type Name Description
IContent content

The content.

AccessLevel requestedLevel

The requested level

Returns
Type Description
System.Boolean

true if user has access else false

Remarks

Note that this method also checks the published status of the page to determine the actual access that the user has. I e if the page is not published the user will not see it unless he has "more" access than Read.

QueryDistinctAccessEdit(IContent, AccessLevel, Nullable<DateTime>)

Queries the distinct access edit.

Declaration
public static bool QueryDistinctAccessEdit(IContent content, AccessLevel requestedLevel, DateTime? requestTime)
Parameters
Type Name Description
IContent content

The content.

AccessLevel requestedLevel

The requested level.

System.Nullable<System.DateTime> requestTime

The request time.

Returns
Type Description
System.Boolean

QueryDistinctAccessEdit(IContent, AccessLevel, IPrincipal)

Queries the distinct access edit.

Declaration
public static bool QueryDistinctAccessEdit(IContent content, AccessLevel requestedLevel, IPrincipal principal)
Parameters
Type Name Description
IContent content

The content.

AccessLevel requestedLevel

The requested level.

System.Security.Principal.IPrincipal principal

The principal.

Returns
Type Description
System.Boolean

QueryDistinctAccessEdit(IContent, AccessLevel, IPrincipal, Nullable<DateTime>)

Queries the distinct access edit.

Declaration
public static bool QueryDistinctAccessEdit(IContent content, AccessLevel requestedLevel, IPrincipal principal, DateTime? requestTime)
Parameters
Type Name Description
IContent content

The content.

AccessLevel requestedLevel

The requested level.

System.Security.Principal.IPrincipal principal

The principal

System.Nullable<System.DateTime> requestTime

The request time.

Returns
Type Description
System.Boolean

QueryDistinctAccessEdit(PageData, AccessLevel)

Return the distinct access level that the current user has to this page.

Declaration
public static bool QueryDistinctAccessEdit(PageData page, AccessLevel requestedLevel)
Parameters
Type Name Description
PageData page

The page to check accesslevel against

AccessLevel requestedLevel

The requested level

Returns
Type Description
System.Boolean

true if user has access else false

Remarks

Note that this method also checks the published status of the page to determine the actual access that the user has. I e if the page is not published the user will not see it unless he has "more" access than Read.

ShouldFilter(IContent)

Should filter.

Declaration
public override bool ShouldFilter(IContent content)
Parameters
Type Name Description
IContent content

The content.

Returns
Type Description
System.Boolean
Overrides

ShouldFilter(PageData)

If the page should be filtered.

Declaration
public override bool ShouldFilter(PageData page)
Parameters
Type Name Description
PageData page

The page that you want to check.

Returns
Type Description
System.Boolean

True if the filter will remove the page; otherwise false.

Overrides

Implements

Extension Methods