Export to SpreadSheet bug ..... please help me

Apr 27, 2009 at 12:08 PM

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);

            itm.BreakRoleInheritance(true);

            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, "", "", "");

                rol.RoleDefinitionBindings.Add(web.RoleDefinitions["Full Control"]);

                itm.RoleAssignments.Add(rol);

                itm.Update();

            }

            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......