I 'v used this code to change the assigned role to an item in the list test
web.AllowUnsafeUpdates = true;
SPListItem itm = web.Lists["test"].GetItemById(ListItem);
while (itm.RoleAssignments.Count > 0)
itm.RoleAssignments.Remove(itm.RoleAssignments.Count - 1);
string UsersCol = users.Split(";".ToCharArray());
foreach (string UserString in UsersCol)
SPRoleAssignment rol = new SPRoleAssignment(UserString, "", "", "");
web.AllowUnsafeUpdates = false;
this code works well and the items are hidden to all users but only the (UsersCol)..
but then I tried to use Export to SpreadSheet action from the toolbar, and opened the query on Excel .......!!!
surprise!!! I can see all the items even I don't have any permission on them..
The same issue happened also with Connect to Outlook action in Document Libraries ....
please help me ASAP......