2

I'm developing a Webpart and I need to go through every document library and get its permissions. Basically I need to get the groups and its permissions associated with the document library.

I have iterated through the properties and methods of a SPDocumentLibrary object but couldn't find anything really.

Any help or guide would be appreciated.

Thank you

empz
  • 11,509
  • 16
  • 65
  • 106

2 Answers2

1

Try SPDocomentLibrary.RoleAssignments. This will give you SPRoleAssignments where the Member property is a SPGroup or a SPUser.

Stefan
  • 14,530
  • 4
  • 55
  • 62
1

I would first check HasUniqueRoleAssignments. If it is false, then the permissions for that document library are inherited from the website. If it is true, as Jason said, I would then check the Member and RoleDefinitionBindings of each SPRoleAssignment.

Rich Bennema
  • 10,295
  • 4
  • 37
  • 58