SaaS CMS has officially launched! Learn more now.

Remove Access From Pages



I'm trying to remove groups from CMS pages in the code behind and nothing I have tried seems to be working. Does anybody have an hints, tips or samples of how to do this?

Thanks in advance,


Feb 15, 2011 17:17

You need to add the role but with AccessLevel.NoAccess. It took me some time before I understood that myself :)

PageAccessControlList acl = new PageAccessControlList(pageRef);
                    acl.Add(new AccessControlEntry(EPiServer.Security.EveryoneRole.RoleName, AccessLevel.NoAccess, SecurityEntityType.Role));


Feb 15, 2011 18:05

Hi Anders,

Many thanks for that, did the trick nicely. One point to note that I had to remove the acl entry prior to adding again with NoAccess as it complained that the entry already existed (fair enough I suppose). It's strange that the Remove method doesn't persist even when you save the list!!

Thanks again,


Feb 16, 2011 10:01

Can't agree more. That API is a bit cryptical :)

Feb 16, 2011 10:02

Could it be that if you just remove Everyone it will inherit Everyone's access righs from the parent? So you have to explicitly add the NoAccess to state that you do not want it to inherit?

Feb 16, 2011 10:37
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.