Sep 19, 2009

How to get all the web of which the current logged in user is part of(Added in any of the Groups)

Scenario :We have a collection of web in the site collection,We need to get the collection of all the webs of which the current logged in user is part of ( present in any of the group)

Sample Code:

SPWeb oWeb = SPContext.Current.Web;

SPWebCollection oWebColl = oWeb.GetSubwebsForCurrentUser();

//This gives all the web object for which the current logged in user is

part of.

Enjoy !!!

No comments:

Post a Comment