AccessControlList is used to restrict access to various items.
Namespace:
EPiServer.SecurityAssembly: EPiServer (in EPiServer.dll) Version: 5.2.375.236
Syntax
| C# |
|---|
[SerializableAttribute] public class AccessControlList : IEnumerable<KeyValuePair<string, AccessControlEntry>>, IEnumerable, IReadOnly<AccessControlList>, IReadOnly, ISecurityDescriptor |
Remarks
ACL holds the Access Control List for a PageData object. Since PageData has the attribute Property which is a PropertyDataCollection, ACL effectively controls access to the Web page. Keep in mind that the Access Control List applies to all of the PageData object and its attributes. It is not possible to have different access permissions for different properties.
The Acccess Control List is comprised of an Access Control Entry, ACE, array and is accessed by calling the method ACL.ToRawACEArray.
Examples
The following code example demonstrates the usage of ToRawACEArray to enumerate the
Access Control Entries. The example enumerates the EPiServer.Security.RawAce objects,
which together form the Access Control List and check if one of them is the Create permission.
CopyC#
The following code example demonstrates the usage of QueryDistinctAccess to check specific
access for the current user.
CopyC#
foreach (EPiServer.Security.RawACE Ace in CurrentPage.ACL.ToRawACEArray()) { if ( ( Ace.Access & EPiServer.Security.AccessLevel.Create ) == EPiServer.Security.AccessLevel.Create ) { // Do Something } }
if ( CurrentPage.ACL.QueryDistinctAccess( EPiServer.Security.AccessLevel.Create ) ) { // Checks whether the currently logged-on user has // Create permission for the current page. }
Inheritance Hierarchy
System..::.Object
EPiServer.Security..::.AccessControlList
EPiServer.Security..::.PageAccessControlList
EPiServer.Security..::.AccessControlList
EPiServer.Security..::.PageAccessControlList