How to get all the folders name from a SharePoint library where the user has edit permission

Rishikesh Rai 55 Reputation points
2023-03-07T08:42:25.0133333+00:00

Hi,

In a SharePoint online site, a document library has 40 folders, each of the folder has a unique permission and as per business requirement I need to show the only folder where the current logging user has edit permission only.

So, is there a SharePoint REST API filter query that will display all the folders name where the user has the edit permission.

Thanks,

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-03-08T05:27:31.42+00:00

    Hi @Rishikesh Rai

    Currently there is no such rest api to get all items which current user have specific permission. You can use following api to get permission of one of the folder and check if the user have edit permission to the folder.

    /_api/web/GetFolderByServerRelativeUrl('DocumentTest/testfolder')/ListItemAllFields/roleassignments?$expand=Member,RoleDefinitionBindings
    

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.