简体   繁体   English

在Sharepoint 2010中获取当前登录的用户

[英]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. 我需要获取当前用户,以便我可以隐藏或显示调查的某些信息,具体取决于当前用户的权限。

SPContext.Current.Web.CurrentUser should do the trick. SPContext.Current.Web.CurrentUser应该可以解决这个问题。 It has functions like IsSiteAdmin and Groups that you should be able to use. 它具有您应该能够使用的IsSiteAdminGroups等功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM