I need to get all users/groups that have permissions on an item x, is there any way to get this information via C#?
1 Answer
Of course you can. You can use CSOM. Connect to web using credentials, get list that you want. Get all items or specific field using caml query
query.ViewXml = "<View/>";
items=SourceList.GetItems(query);
clientContext1.Load(items);
clientContext1.ExecuteQuery();
Each item like SecurableObject has it's permissions list.
- item.RoleAssignments; - it is permissions list
- each permission has:
- permission.RoleDefinitionBindings
- permission.Member
-
Could use fleshing out a bit...– user43832Commented Jul 24, 2018 at 14:28