question

PrasannaJain-9823 avatar image
0 Votes"
PrasannaJain-9823 asked PrasannaJain-9823 commented

API to get List of Persons having access to sharepoint folders

Dear Experts,

Is there any API through which i can get list of all users who have access to a particular folder ( say folder1) during certain day/time ?

As i want to monitor the access in my application so if these are exposed via API's would be preferred.

Looking forward for your kind help.

Best Regards,
Prasanna

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TongZhangMSFT-7548 avatar image
0 Votes"
TongZhangMSFT-7548 answered PrasannaJain-9823 commented

Hi @PrasannaJain-9823,

According to my research and testing, there is no way to get list of all user who have access to a particular folder during certain day/time.

However ,as a workaround, you can use the follow REST API to get which user have access to SharePoint folder:

 GET    /_api/web/lists/getByTitle('ListName')/items(item-id)/RoleAssignments?$expand=Member,RoleDefinitionBindings

OR

 GET   /_api/web/getFolderByServerRelativeUrl('/sites/xxx/test/newfolder1')/ListItemAllFields/RoleAssignments?$expand=Member,RoleDefinitionBindings 

My test result:

202690-001.png


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






001.png (63.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PrasannaJain-9823,

I am checking to see if the problem has been resolved. If you have any questions or progress, you can contact me in time.

1 Vote 1 ·

Thank you Tong, It should help

Could you please expand the results JSON so i can see the what is the format of returned user's JSON

0 Votes 0 ·