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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
SPContext.Current.Web.CurrentUser
should do the trick. It has functions like IsSiteAdmin
and Groups
that you should be able to use.