Here's a simple yet useful method for checking membership in a SharePoint group. This method will return true or false to indicate if the current user is a member of the specified SharePoint group in the current site. The current user is obtained from an assumed impersonation context.
public static bool IsUserInGroup(string groupName) { bool inGroup = false; try { SPGroup group = SPContext.Current.Web.Groups[groupName]; inGroup = group.ContainsCurrentUser; } catch (Exception ex) { // SharePoint throws an exception if the group indexer // is not a group the current user belongs to. inGroup = false; } return inGroup; }