Christian
Christian

Reputation: 51

Get current logged user in Sharepoint 2010

I have a web part that shows me a survey. I need to get the current user so that I can hide or show certain information for the survey depending on the current user's permissions.

Upvotes: 4

Views: 17343

Answers (1)

skeletank
skeletank

Reputation: 2888

SPContext.Current.Web.CurrentUser should do the trick. It has functions like IsSiteAdmin and Groups that you should be able to use.

Upvotes: 9

Related Questions