Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

DoesUserHavePermissions is True, even if user has no access!

$
0
0

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


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>