Try our conversational search powered by Generative AI!

Problem with saving a ContentAccessControlList.



I have a problem with saving a ContentAccessControlList. 

When i create a specific pagetype i want to programatically create a set of containers and subpages and set their access rights. 

Creating a page and its subpages/containers works fine but when i try to set the access rights for each subpage i get this error when i try to save.

System.NotSupportedException: 'Specified method is not supported.'

The Code:

public static void SetAccessRightsForPongChildPages(PageData page, string productCode = null)

var pageAccessControlList = new ContentAccessControlList(page.PageLink)

new AccessControlEntry("Administrators", AccessLevel.FullAccess, SecurityEntityType.Role),
new AccessControlEntry(ConfigurationManager.AppSettings["EPiRoleAdmin"], AccessLevel.FullAccess, SecurityEntityType.Role)


if (page is ContainerBasePage)

pageAccessControlList.Add(new AccessControlEntry("Everyone", AccessLevel.Read, SecurityEntityType.Role));


if (productCode != null)
       pageAccessControlList.Add(new AccessControlEntry(ConfigurationManager.AppSettings["EPiRoleProdOwnerBase"] + productCode,
       AccessLevel.FullAccess & ~AccessLevel.Administer & ~AccessLevel.Publish, SecurityEntityType.Role));




I have also tried using pageAccessControlList.Save(SecuritySaveType.Replace);. 

Happy if anyone can point me in the right direction :)

[Pasting files is not allowed]

Edited, Dec 20, 2017 14:44

which epi version are you on?

Dec 21, 2017 0:19

Im currently on version 10.10.

Dec 21, 2017 8:17

You can update acl:s through EPiServer.DataAbstraction.IContentSecurityRepository.Save, the instance of IContentSecurityRepository can be retreived from IOC container 

Jan 08, 2018 13:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.