Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have an external application which displays all sub-sites and document libraries where the user has write permissions. At the moment I am using "GetRolesAndPermissionsForCurrentUser" to get permissions for each sub-site and "GetListItemChangesSinceToken" to get permissions for each library.

But this is a very time taking process as, if there are 100 sub-sites I need to make a web-service call for each sub-site .i.e., 100 calls. Is there any way to get all the sub-sites and document libraries where the user has Write permission? Or at least any way that I can piggyback all the web-service requests for all the sub-sites in one call.

share|improve this question
add comment

1 Answer

EDIT Just realised you are performing this task using Web services. Back to the drawing board (I don't have access to delete the post)!


I'm not really a developer but this is a fairly common scenario and it sparked my interest. I imagine there is a better way of doing it but this may work:

You could construct a CAML query using the SPSiteDataQuery class to retrieve all lists in the site collection.

To view permissions you could specify the "IncludeAllUserPermissions" property in a where clause that defines the SPSiteDataQuery.Query property.

SPSiteDataQuery returns a DataTable object that should contain the lists and permissions assuming the above is correct.

If I get a chance I may give this a try on a test VM, but let me know how you get on.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.