SPWeb.GetSubwebsForCurrentUser Method (Microsoft.SharePoint)
Returns the collection of subsites beneath the current Web site of which the current user is a member.
Overload List

Name Description
SPWeb.GetSubwebsForCurrentUser ()
Returns the collection of subsites beneath the current site of which the current user is a member.
SPWeb.GetSubwebsForCurrentUser (Int32)
Returns the collection of subsites beneath the current Web site of which the current user is a member based on the specified site definition.
SPWeb.GetSubwebsForCurrentUser (Int32, Int16)
Returns the collection of subsites beneath the current Web site in which the current user is a member, based on the specified site definition and configuration.
See Also

Tags :


Community Content

marlobello
Works only for Site Collection
This only works if the current SPWeb object is the RootWeb of the Site Collection.
Don;t expect any result when the current site is only a simple web.

Derek Himes
Problem with Site Level Visibility with Custom Permissions

Note that this will work only at the top or specified level if the user doesn't have permissions via inheritance in sharepoint.

If a user doesn't have permission at a top level site (parent) although they have permission in a subsite (child), the child will not get returned by this method.

Since the user doesn't have permission at the top level, it is hidden from the current user's context and therefore doesn't get queried by this method.


Page view tracker