1

I would like to get a list of documents where user x and y has permissions. Can someone help me? I would like to do it in either PowerShell or C# code.

1 Answer 1

0

You can use the SPList.DoesUserHavePermission() method on lists.

foreach (var list in web.Lists)
{
    SPFieldUserValue flduserVal = new SPFieldUserValue(web, "1#;Administrator");
    SPUser user = flduserVal.User;
    bool hasPermissions = web.DoesUserHavePermissions(SPBasePermissions.ViewListItems);
    //some code
}

More info on msdn.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.