I'm using the following code:
protected void TraverseFolder(SPList list, SPFolder folder)
{
SPQuery qry = new SPQuery() { Folder = folder };
SPListItemCollection listFolderItems = list.GetItems(qry);
foreach (SPListItem item in listFolderItems)
{
// Do stuff.
}
}
If the items in the list inherit their permissions from the parent folder then they appear in the collection, if I break inheritance, but keep the same permissions, they don't appear. What's going on?
Stuart.
UPDATE: If I ensure that the user has View Only permissions on another folder (at the same level as the files they can't see) then the files are returned in GetItems. If I take that permission away they don't get returned.