4

I wanted to notify via email all those users having access or shared the listitem/folder and file with given item level permission.

As my solution I was sending notification to the shared with field people and group. But if we remove the permissions for the user or group with whom we shared the document.

However, the user or group is still displayed in the Shared With column.

As per microsoft KB article https://support.microsoft.com/en-us/kb/2987770

How can I find the list of people who having access of ListItem?

2 Answers 2

0

It is very interesting to know about 'Shared With'. So, it does a good job of keeping the log.

I would check for the permissions of each person entry in 'Shared With' to see if the permissions are still effective!

SP.ListItem.effectiveBasePermissions property

SPBasePermissions enumeration

Similarily I will check for each group that has access on the list. Check if the list item has unique permissions and similarly for the list. If there are no unique permissions, then all the groups of the web will apply.

SPSecurableObject class

It is not elegant but I guess it does the job! Please let us know your feedback and I will post again if i can think of something better!

1
  • SP.ListItem.effectiveBasePermissions property returns permissions of current user. If you want to check permissions of other users you can use getEffectivePermissions(userName) method. Sep 20, 2015 at 14:46
0

You can use REST API to check role assignments for ListItem:

/_api/web/lists/getByTitle('Documents')/items(1)/RoleAssignments?$expand=Member,RoleDefinitionBindings
  • In getByTitle() you need to pass title of your list
  • In items() you need to pass ID of list item

As result you'll get collection of RoleAssignments. Member property will contain information about user or group, RoleDefinitionBindings information about permission level.

Of course can modify query to get this info for all items or specific subset. You should also consider using $select to limit amount of data returned from the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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