SharePoint Foundation 2010: Is it possible to Check if a logged in user is member of a certain group?

Posted on 2012-08-20
Last Modified: 2012-08-25
Hello. Is it possible to check if current user belongs to specified group (etc)? I know this is possible with SharePoint, but what aboutSharePoint Foundation 2010. Does SharePoint foundation allow me to do something like this:

SPWeb theSite = SPControl.GetContextWeb(Context); 
SPUser theUser = theSite.CurrentUser; 
string strUserName = theUser.LogonName; 

Open in new window

Basically I would like to know if user is member of a certain group and use this information to redirect him/her if necessary.
Question by:tolppa
    LVL 44

    Accepted Solution

    yes, this should be possible.

    LVL 5

    Assisted Solution

    LVL 44

    Expert Comment

    by:Rainer Jeschor
    To verify if some server-side object code should work in SharePoint foundation just download the SharePoint foundation SDK (which offers some nice coding examples as well):

    If the object/method is not available in there then this functionality should be related to the Server editions of SharePoint.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
    Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now