tag:blogger.com,1999:blog-1691561765197444562.post823078382583269322..comments2023-05-26T06:56:57.409-05:00Comments on SharePoint Application Development: Access Denied when using SPSite.AllWebsChrishttp://www.blogger.com/profile/07661192273686528331noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-1691561765197444562.post-17517511131266527262010-03-25T07:21:34.831-05:002010-03-25T07:21:34.831-05:00I had a similar issue with a custom build site. Us...I had a similar issue with a custom build site. Users were getting access denied on the main page, but could browse the rest of the site. As soon as we added the user to site owners group they could see the page...<br /><br />The developer had a dynamic menu that was different depending of a user is a site owner or not...<br /><br />We fixed the problem by letting user view the membership of the "Site Owners" group. The web part was trying to see if the user that was accessing the site is a site owner, and since the user did not have rights to see who is in that group we got the access denied. It's the second time i bump into this issue - and the second time I end up spending a week troubleshooting this. Hopefully this will help somebody else.applicationdevelopmenthttp://www.fomaxtech.com/services.htmlnoreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-74398297305605770312010-03-04T01:14:33.660-06:002010-03-04T01:14:33.660-06:00The linked white paper from Steve Peschka only cov...The linked white paper from Steve Peschka only covered list performance, and did not seem to mention AllWebs or GetSubwebsForCurrentUser, or indeed, webs in any form. Also, it said that PortalSiteMapProvider may not be used from WinForm applications.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-45895686415961908212009-02-02T17:23:00.000-06:002009-02-02T17:23:00.000-06:00Eric, it is my understanding that GetSubwebsForCur...Eric, it is my understanding that GetSubwebsForCurrentUser() isn't recursive, so it wouldn't be that much of a performance killer unless all 200 of your subsites were directly underneath the calling site.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-83589062497543264972008-12-05T04:43:00.000-06:002008-12-05T04:43:00.000-06:00I've tried to use GetSubwebsForCurrentUser() inste...I've tried to use GetSubwebsForCurrentUser() instead of AllWebs, but the problem is that it misses out the current site.<BR/>On my site if I call AllWebs, I get a collection of 7 sites. Topsite, plus 6 subsites. When I call GetSubWebForCurrentUser() it returns a collection of 6 sites, it doesn't include the top site. I need to iterate through all 7 sites, how could I acheive this? I thought about using SPWebCollection.Add to add my missing site to the collection, but that isn't right is it?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-21568020868850349392008-10-21T09:23:00.000-05:002008-10-21T09:23:00.000-05:00Thanks a lot for this tip - I never would have fig...Thanks a lot for this tip - I never would have figured this out!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-88038860195375076892008-09-05T12:59:00.000-05:002008-09-05T12:59:00.000-05:00I spent an entire 8-hour shift looking for a way t...I spent an entire 8-hour shift looking for a way to use the AllWebs without throwing that error. Elevated permissions with impersonation of the current user refused to work unless the current user is a site collection owner. I just wanted to thank you for posting this finding.illogicalhttps://www.blogger.com/profile/08931804024217387759noreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-91097108315724169282008-01-18T09:01:00.000-06:002008-01-18T09:01:00.000-06:00Eric,Thank you so much for this tip. You've added ...Eric,<BR/><BR/>Thank you so much for this tip. You've added to my reading list!Chrishttps://www.blogger.com/profile/07661192273686528331noreply@blogger.comtag:blogger.com,1999:blog-1691561765197444562.post-54634041240815346402008-01-17T23:12:00.000-06:002008-01-17T23:12:00.000-06:00Be very careful with the use of both GetSubwebsFor...Be very careful with the use of both GetSubwebsForCurrentUser() and SPSite.AllWebs(). These two OM methods are both performance killers on large sites (200+ subsites). Instead, use the PortalSiteMapProvider methods described in Steve Peschka's white paper (http://go.microsoft.com/fwlink/?LinkId=95450&clcid=0x409). You may not see much performance impact now, but you'll thank Steve later when your site grows up and your code starts to sputter and die...Eric Shuppshttps://www.blogger.com/profile/05832504036790762785noreply@blogger.com