Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Listing document libraries that a user has permission to in a provider hosted app

$
0
0

Hi,

I have a provider hosted app and I want to list out specific document libraries on a site that a user has permission to. I have the following code which is getting me a list of all the document libraries on the site but how do I:

a) Change this so that is only list document libraries that the current user has permission to view

b) Only show specific document libraries (it appears to be showing system created ones such as "Form templates", "Site assets" etc

ListCollection lists = clientContext.Web.Lists;
clientContext.Load<ListCollection>(lists);
clientContext.ExecuteQuery();

foreach (List list in lists)
{
    clientContext.Load(list, l => l.DefaultViewUrl);
    clientContext.ExecuteQuery();

    documentLibraries.Add(list);
}}

Regards

Tony


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>