So I have a list of managers in my SharePoint site, and I am able to get the current user by using a web service and storing their name into a control. Is it possible to compare this name to everyone in that list/group to check if they are a manager so that the form can switch views to the manager section?

Right now I created a drown down control which pulls in values from the list and sets the default value to the contact. But it can only store and compare one contact. How could I have it compare the current user against everyone in the list?

Thank you in advance.

1 Answer 1


You can use a SharePoint group instead, put your managers in it, and then use something like this to see if the current user is a member:

    bool IsMember(string groupName)
            return SPContext.Current.Web.SiteGroups[groupName].ContainsCurrentUser;
            return false;
  • nice work, is there a way to do it without code?
    – tehman
    Oct 12, 2011 at 13:35
  • 1
    If by "no code" you mean no compiled code, and you are willing to roll up your sleeves an write some javascript, it can be done. Here's an msdn article that explains working with users and groups in client side script: msdn.microsoft.com/en-us/library/hh185012.aspx
    – Jon Lester
    Oct 13, 2011 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.