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)
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top