I want to dynamically build a collection of all sites a given use has access to, now I've tried SPWeb.GetSubwebsForCurrentUser() but this only returns the sub sites under the current site the user is accessing, for example:
Admininstrations - Users - Permissions
If the user is currently browsing default.aspx under Administration, GetSubwebsForCurrentUser() will return Users and Permissions, but not Administration. Now I can include this in my collection, but what about the other webs at the root?
Home (has access) - Catalog (admin only) - Products (admin only) - Administration (admin only) - Administration (has access + all subs) - Users - Permissions - Site 1 (has access)
Should produce a collection like follows:
Home - Administration - Users - Permissions - Site 1
So I had a look at passing search queries across, but I don't have search services enabled on the system, as we don't need it, so that won't work.
Also had a look SPContext.Current.Site.RootWeb.GetSubwebsForCurrentUser() but this throws an exception of call stack when trying to iterate through the collection and I can't figure out why, that said, if it throws an exception I can safely assume the user does not have access, but as you can imagine, if my site is massive, an iterative check like this will take some time.
So the question, is there an easier way to determine the levels a user has access to, without querying SQL directly, because that's my last resort.