1

I want to check if specific user has which permission for specific file or folder of any document library in share point client object model.

1

SPlistitem has a function DoesuserhavePermission, http://msdn.microsoft.com/en-us/library/ms472022.aspx

try this one,

SPList objList = web.GetList(this.NewsItemURL);
SPListItem objListItem = null;

try
{
     objListItem = objList.GetItemById(_intNewsItemID);
 if (!objListItem.DoesUserHavePermissions(web.CurrentUser, SPBasePermissions.ViewListItems))
 {
     _strErrMsg = "Does not have permission";
 }

}

catch (ArgumentException)
{
     objListItem = null;
}

Also very good article. http://melick-rajee.blogspot.com/2013/11/how-to-check-user-permission-for-web.html

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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