0

I'm doing a REST to get "SharedWithUsers" field.

My query is expanding ID and Title of "SharedWithUsers" field:

var REST = globalvars.absoluteUrl + "/_api/web/lists(guid  '" + globalvars.libraryGUID + "')/items?"+
                                    "$expand=File,File/ModifiedBy,Author,ParentList,SharedWithUsers&"+
                                    "$select=ID,Title,Tags,File_x0020_Type,FileLeafRef,Classificacao,Created,Modified,Author/Title,Author/ID,Author/Name,ParentList/ID,File/ModifiedBy,File/ServerRelativeUrl,File/Name,SharedWithUsers/ID,SharedWithUsers/Title&" + 
                                    "$filter=" + filter;

I don't know if the roles of each users (example: view only role or edit role) can be expanded with this query. I didnt found any documentation about that.

How can I retrive role information? Is possible expanding SharedWithUsers field?

Sorry for my english.

1 Answer 1

0

You can use the following REST API to get the item permissions along with role definition. It will list the users and SharePoint groups which have the permission on the item and the roles assigned to each user and group.

<site>/_api/Web/Lists(guid'<guid>')/Items?$select=RoleAssignments/Member/LoginName,RoleAssignments/RoleDefinitionBindings/Name&$expand=RoleAssignments/Member,RoleAssignments/RoleDefinitionBindings

RoleAssignment class

Your Answer

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

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