문제

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