Class RawACE
Raw data contained in AccessControlList
Inheritance
Inherited Members
Namespace: EPiServer.Security
Assembly: EPiServer.dll
Version: 11.20.7Syntax
public class RawACE
Examples
The code example below demonstrates the usage of AccessControlList, RawACE and AccessControlEntry.
The example below sets up access rights on a "personal" start page. Administrators gets full access,
the creator gets everything except for administer and any other user/group that
has at least read access on the team start page gets read access rights.
page is the page to update the access rights on.
private void SetAccessRights(PageData page)
{
PageData teamStart = Locate.ContentRepository().Get<PageData>(page.ParentLink);
AccessControlList aclClone = page.ACL.CreateWritableClone();
aclClone.IsInherited = false;
aclClone.ClearEntries();
foreach (RawACE ace in teamStart.ACL.ToRawACEArray())
{
if ((ace.Access & AccessLevel.Read) == AccessLevel.Read && ace.Name != PrincipalInfo.Current.Name && ace.Name != "Administrators")
{
aclClone.Add(new AccessControlEntry(ace.Name, AccessLevel.Read, ace.AutomaticEntryType));
}
}
aclClone.Add(new AccessControlEntry("Administrators", AccessLevel.FullAccess, SecurityEntityType.Role));
aclClone.Add(new AccessControlEntry(PrincipalInfo.Current.Name, AccessLevel.FullAccess & ~AccessLevel.Administer, SecurityEntityType.User));
aclClone.Save(SecuritySaveType.Replace);
}
Constructors
RawACE()
Declaration
public RawACE()
Fields
Access
The access level defined by this ACE.
Declaration
public AccessLevel Access
Field Value
Type | Description |
---|---|
AccessLevel |
EntityType
The SecurityEntityType for this ACE.
Declaration
public SecurityEntityType? EntityType
Field Value
Type | Description |
---|---|
System.Nullable<SecurityEntityType> |
Remarks
This was added in CMS6R2, so any older package will have this value set to User.
SID
A Security Identity for the ACE.
Declaration
public int SID
Field Value
Type | Description |
---|---|
System.Int32 |
Remarks
The concept of SIDs are obsolete as of EPiServer CMS 5, but due to compatibility with EPiServer 4 data this property has not yet been obsoleted. However you should avoid using it unless absolutely necessary.
Properties
Name
Gets or sets the name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name. |
Remarks
This property contains logic to deal with the EPiServer 4 concept of SID (Security IDentifiers - not identical to the SIDs as used by Windows). Importing data from an EPiServer 4 site just gives you the SID, not the actual user / role name and this property will map a couple of well known SIDs into names.