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?


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.

  • What version of SharePoint are you using? Could you add the tag for it?
    – Mike H
    Jul 5, 2010 at 23:48
  • Are you able to include a screenshot of the permissions set for the list, folder, and list items?
    – Alex Angas
    Jul 6, 2010 at 23:11

2 Answers 2


Upgraded the SharePoint version to Service Pack 2 ( and this resolved the issue.


Verify that the permissions really do match up. If you're running in a web part, output SPContext.Current.Web.CurrentUser.LoginName. Double-check this username against the permissions for the list, folder, and list items you are expecting to see.

Alternatively run the code with elevated privileges and see if it works.

  • Hi Alex, I've output the login name of the user and it outputs the user as expected. I have an alternate function which runs under elevated privileges and that runs fine, but for performance reasons I need to run under the current user context (explicitly checking permissions takes too long). The user has View Only permission on the files in question, both when inheriting and when broken. Jul 14, 2010 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.