Try our conversational search powered by Generative AI!

Remove a role in ACL on CurrentPage

Vote:
 
if (!CurrentPage.ACL.Exists(roles.Items[i].Value)){ //This code work fin ac = new AccessControlEntry(roles.Items[i].Value, AccessLevel.Read, SecurityEntityType.Role); CurrentPage.ACL.Add(ac); CurrentPage.ACL.Save(); } But how can I remove a role from ACL on CurrentPage? //I have tryed this, but it did not work. if (CurrentPage.ACL.Exists(roles.Items[i].Value)) { CurrentPage.ACL.Remove(roles.Items[i].Value); CurrentPage.ACL.Save(); }
#15801
Oct 02, 2007 15:36
Vote:
 
Try this CurrentPage.ACL.Remove(roles.Items[i].Value); CurrentPage.ACL.Save(SecuritySaveType.Replace);
#16391
Feb 05, 2008 12:42
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.