Question

I have site collection and iterating user permissions for each subsites underneath. I have see couple sites have permissions to see. But when i do in the code level (below code) giving results false.

I don't know have to get his permissions other than this. When I go to url he has permission to see.

Please help me out.

    sweb.DoesUserHavePermissions(suser.LoginName, SPBasePermissions.ViewPages |
 SPBasePermissions.ViewListItems | SPBasePermissions.ViewFormPages)
Was it helpful?

Solution

Your code checks if the user has all three View permissions, which apparently isn't the case. If you just want to check if he has the most basic access, then you should check for SPBasePermissions.Open

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top