The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Thank you so much for your reply
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have one page in sharepoint site.in that page 15 document library links or there.Onclick of one link i can see that document library.I have 5 departments(for ex.A,B,C,D,E)in my company.In some document they everyone is having permission.In some document library some people are not having permission.Like that some people are not having permission in folder also.i want to check in A department is having permission in which document libraries and what are the folders.like that B,C,D,E.
I have Created 5 lists (A,B,C,D,E).In A list that department people names are there.like that their department names are there in everylist.I have created 5 buttons(A,B,C,D,E).Onclick of A i want to see the page of the document library link(what are the document libraries A department people are having permission that document library link should come in that page.on click of one document library what are the folders are shared with A department people that folders only should come.Atleast one person is having permission in one folder also that folder should come.No one is having permission in any folder from A department that folder should not come.I am having permission in every document library and every folder.in my id i have to check what are the document libraries and folders are shared for their department. am using c#.
The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Thank you so much for your reply
Hi @Bharathi Paulraj
Per my test, I will recommend you to use CSOM to get folder permissions. Please refer to following code
var list = clientContext.Web.Lists.GetByTitle("TestLibrary");
var items = list.GetItems(CamlQuery.CreateAllFoldersQuery());
clientContext.Load(items, icol => icol.Include(i => i.RoleAssignments.Include(ra => ra.Member), i => i.DisplayName));
clientContext.ExecuteQuery();
foreach (var item in items)
{
Console.WriteLine("{0} folder permissions", item.DisplayName);
foreach (var assignment in item.RoleAssignments)
{
Console.WriteLine(assignment.Member.Title);
}
}
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.