I have an org (Dev, Winter 14) where I created a custom report folder and restricted access from my other user. When I log in as that user, he cannot see the custom report folder in the Report tab. However, I wrote the APEX controller and VF Page below, and he can see the folder being returned in the query.
Strangely enough, I can't seem to replicate this on another org. The only oddity I could find for this user is that I'm using a platform license, but there doesn't appear to be any other profile settings set that would give extra access. It mostly seems strange that the security is different in two parts of the application.
APEX Controller:
public with sharing class A_Test
{
public List<Folder> stuff {get;set;}
public A_Test()
{
stuff = [SELECT id,name,developername FROM folder WHERE name!='' and developername!='' and type='Report'];
}
}
VF Page:
<apex:page controller="A_Test">
<apex:repeat value="{!stuff}" var="s">
<apex:outputText value="{!s.Name}"/><br/>
</apex:repeat>
</apex:page>