This project has moved. For the latest updates, please go here.

how to use GetAllSubWebCollection to display links to subsites

Apr 13, 2011 at 6:41 AM

How can i get the below to display all the subsites of a site collection?
Also would do users need to have admin right to get the data if yes how can i elevate privilages.
What i really want to do is show links based on wheter they have access to the site or not

script language="javascript" type="text/javascript"> $(document).ready(function() { $().SPServices({ operation: "GetAllSubWebCollection", completefunc: function(data, status) { //alert($("Web", data.responseXML).eq(7).attr("Url")); }}); }); </script>
Thanks in Advance

Apr 13, 2011 at 11:52 AM

With the Web Services, there's no way to elevate privileges. You are always going to get results filtered against the current user's credentials.


Apr 13, 2011 at 1:31 PM

Thanks Marc.
So if i don't need to elevate privileges how can i make use of the

GetAllSubWebCollection ?

Will it hide and show links of sites/subsites if users don't have access to them?
Apr 13, 2011 at 1:43 PM

It will show sites/subsites which the current user has permissions to see. That's how the Web Services work.