Gowtham

Gowtham

  • 1.4k
  • 514
  • 26.7k

To retrieve user level permission for List/Library using COM

Feb 21 2017 3:27 AM
Based on list name I have to get permission level for users.
Eg:
administrator- Full control
user1-View only
user2-Read only. etc. 
 
So for tried:
List myList = ctx.Web.Lists.GetByTitle("mylist");

roles = ctx.LoadQuery(
myList.RoleAssignments.Include(
roleAsg => roleAsg.Member,
roleAsg => roleAsg.RoleDefinitionBindings.Include(
roleDef => roleDef.Name, // for each role def, include roleDef’s Name
roleDef => roleDef.Description,
roleDef => roleDef.RoleTypeKind,
roleDef => roleDef.BasePermissions)));