Domanda

Im trying to write rest to understand which users has access to a certain files and folder. What REST calls can I use to get which users has access to a file or folder?

È stato utile?

Soluzione

For a file you could try the below endpoint:

/_api/web/getFileByServerRelativeUrl('/Shared Documents/Document.docx')/ListItemAllFields/RoleAssignments?$expand=Member,Member/Users,RoleDefinitionBindings 

For a folder :

/_api/web/getFolderByServerRelativeUrl('/Shared Documents/Folder1')/ListItemAllFields/RoleAssignments?$expand=Member,Member/Users,RoleDefinitionBindings 

Altri suggerimenti

Use below REST endpoint to get the users who has access to files with their permissions:

<siteUrl>/_api/web/getFolderByServerRelativeUrl('Shared Documents/General')?$expand=ListItemAllFields/RoleAssignments/Member,ListItemAllFields/RoleAssignments/RoleDefinitionBindings,ListItemAllFields/RoleAssignments/Member/Users

Reference: How to get permission levels for Files/Folders/Documents in Sharepoint using rest endpoints?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top