質問

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?

役に立ちましたか?

解決

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 

他のヒント

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?

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top