This post has been migrated from www.experimentsincode.com, we apologise if some of the images or content is missing

This post has been migrated, original date 05 Oct 2009 If you have something like the following in you code:
	 SPSecurity.RunWithElevatedPermissions(()=>{
	   SPSite site = new Site(siteId, user.UserToken);
  	   SPWeb web = site.AllWebs[webId];
	 });
You may receive an access denied message anyway. Make sure you use
site.OpenWeb(webId)
.