The below code will get me all of the sub-areas under home but it will
also get areas the current user doesn't have access to. Anyone know
how-to fix this?
'Get the topology manager
Dim topologyManager As TopologyManager = New TopologyManager
'Get the context of the web
Dim site As System.Web.HttpContext = context.Current
'Get all the porta sites
Dim sites As PortalSiteCollection = topologyManager.PortalSites
'Get the corresponding portal site context
Dim PContext As PortalContext
'home area
PContext = PortalApplication.GetContext(site)
'Get the home area's guid
Dim homeGuid As Guid = AreaManager.GetSystemAreaGuid(PContext,
SystemArea.Home)
'Get the Home area
Dim homeArea As Area = AreaManager.GetArea(PContext, homeGuid)
For Each childSite As Area In homeArea.Areas
If childSite.IsKeywordItem = False And childSite.Title <>
"Search" And childSite.Title <> "Targeted links on My Site" Then
newRow = ds.Tables("Sub_Menu").NewRow()
newRow("parentMenuID") = 1
newRow("subMenuTitle") = childSite.Title.ToString()
newRow("URL") = childSite.WebUrl
ds.Tables("Sub_Menu").Rows.Add(newRow)
End If
Next