Skip to content
Loading
show only the sub sites which the current user has access
0
  • Thanks for the reply but.I need it in jsom
    0
  • Nanddeep Nachan
    Please try below code.
    1. SPSecurity.RunWithElevatedPrivileges(delegate()   
    2. {  
    3.     foreach (SPWebApplication webApp in SPWebService.ContentService.WebApplications)  
    4.     {                      
    5.         foreach (SPSite siteCollection in webApp.Sites)  
    6.         {  
    7.             foreach(SPWeb web in siteCollection.RootWeb.GetSubwebsForCurrentUser())  
    8.             {  
    9.                  Console.WriteLine(web.Url);  
    10.             }  
    11.         }  
    12.     }  
    13. });  
     
    0