Hi,
i am using the following line of code to check if user has access to site:
if (siteCollection.RootWeb.DoesUserHavePermissions(currentUser, SPBasePermissions.Open))
I do this inside of RunWithElevatedPrivileges but saving the SPContext User BEFORE RunWithElevatedPrivileges. While i am debugging my solution i see that the "correct" user, which i store into variable currentUser.
But even the user has no access to the site, checking on SPBasePermissions.Open on some Sites gives me True. When i try to open the Site with the User, i get an Error.
I do not use Anonynous-Access anywhere.
Hope that someone has an idea why this happens.
Best Regards
Bog
Developers Field Notes | www.bog1.de