I want to copy role assignments from one folder and set it to other folder
I am basically creating a subfolder and I want that folder to have same permission as its sibling
I tried
Folder sourceFolder = oWeb.GetFolderByServerRelativeUrl("Affaires/Test Affaire/Mails"); ctx.Load(sourceFolder); ctx.ExecuteQuery(); Folder destinationFolder = folder.Folders.Add("Demo"); destinationFolder.ListItemAllFields.BreakRoleInheritance(false, false); RoleAssignmentCollection roleAssignments = sourceFolder.ListItemAllFields.RoleAssignments; ctx.Load(roleAssignments); ctx.ExecuteQuery(); foreach (RoleAssignment item in roleAssignments) { //not sure what to do here! destinationFolder.ListItemAllFields.RoleAssignments.Add(item.PrincipalId, item.RoleDefinitionBindings); }