SaaS CMS has officially launched! Learn more now.

Class AccessAttribute

Defines the ACL list for a typed ContentType.

Inheritance
System.Object
System.Attribute
AccessAttribute
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeId
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAnnotations
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class AccessAttribute : Attribute, _Attribute
Remarks

This attribute only has effect if it is paired with the ContentTypeAttribute. The values from this attribute are used to create the ACL list on the ContentType object. Access rights can be set for Users, Roles and Visitor groups.

Refer to "Attributes" and "Pages, Page Types and Page Templates" under "Content" in the Developer Guide for more information and examples.

Examples

Here is an example on how you can set access on your page type using the Access attribute.

Constructors

AccessAttribute()

Initializes a new instance of the AccessAttribute class.

Declaration
public AccessAttribute()

Properties

Access

Gets the access level.

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

NameSeparator

Gets or sets the characters used to separate the names for the users, roles, and visitor groups. Default value is ",".

Declaration
public string NameSeparator { get; set; }
Property Value
Type Description
System.String

Roles

Gets the names of the roles that has the access level

Declaration
public string Roles { get; set; }
Property Value
Type Description
System.String

Users

Gets the names of the users that has the access level

Declaration
public string Users { get; set; }
Property Value
Type Description
System.String

VisitorGroups

Gets the names of the visitor groups that has the access level

Declaration
public string VisitorGroups { get; set; }
Property Value
Type Description
System.String

Implements

System.Runtime.InteropServices._Attribute

Extension Methods

See Also

PageTypeAttribute
AvailablePageTypesAttribute