开发者

Sharepoint Web services: How to get permissions for a Document Library for the current user programmatically

I have an application where i wish to display all document libraries for which the current user has Write permissions. How can i get this information... GetLists doesnt return me anything about permissions... Whereas, "GetPermissionCollection" only returns me the permissions when the user has Full control as 开发者_开发百科permissions....so it is of no use... :(

Dont we have anything like "GetRolesAndPermissionsForCurrentUser" to get permissions for lists. I am using this to get the site level permissions for the current user... But this does not work for lists :(

Someone please do help..... :(


You can check for the permissions the current user has on the list:

List<SPList> lists = new List<SPList>();
foreach (SPList spList in properties.Web.Lists)
{
  if (spList.DoesUserHavePermissions(SPBasePermissions.EditListItems))
  {
    lists.Add(spList);
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜