Установка прав для элемента списка

21
Авг,2012

0

foreach (SPListItem contractItem in reestrContract.Items) { if (!contractItem.HasUniqueRoleAssignments) { contractItem.BreakRoleInheritance(true); } SPFieldUserValue UV = new SPFieldUserValue(web, contractItem[«Кому»].ToString()); SPPrincipal myGroup = UV.User; SPRoleAssignment assignedToRoleAssignment = new SPRoleAssignment(myGroup); assignedToRoleAssignment.RoleDefinitionBindings.Add(web.RoleDefinitions[«Чтение»]); contractItem.RoleAssignments.Add(assignedToRoleAssignment); i++; Console.WriteLine(i); }