I'm trying to list all the links on all the SharePoint web sites (parent and sub). When I'm logged in as the admin user it works just fine. However, when I sign on as a normal user I get an access denied error. And the error is thrown when I check the count property of the SPWebCollection.
SPSite oSiteCollection = SPContext.Current.Site;
SPWebCollection collWebsite = oSiteCollection.AllWebs;
StringBuilder labelText = new StringBuilder();
for (int i = 0; i < collWebsite.Count; i++) // <---- Access denied on count
{ // get links }
I tried adding giving my normal user full site control and I still received the access denied error. Any idea what access rule is being checked when accessing the count property?