Sharepoint列表按配置文件属性过滤 [英] Sharepoint List Filter by Profile Property
问题描述
如何通过当前用户的配置文件属性筛选Sharepoint(WSS 3.0)中的列表。例如,我有一个列表与部门列,我想根据当前用户的部门(这将是一个用户配置文件的属性)筛选列表。
任何想法如何做到这一点?
您需要做的是首先获取用户的配置文件,查找属性,然后在你的CAML中使用它,如下所示:
$ b $ pre $ UserProfile userProfile = ProfileLoader.GetProfileLoader()。GetUserProfile();
string dept = userProfile [department];
// SPQuery CAML这里的东西
How would you filter a list in Sharepoint (WSS 3.0) by a current user's profile property. For example, I have a list with a Department column and I want to filter the list based on the current user's department (which would be a user profile's property).
Any idea's on how to do this?
What you'll need to do is first get the user's profile, look up the property, and then use that in your CAML, like so:
UserProfile userProfile = ProfileLoader.GetProfileLoader().GetUserProfile();
string dept = userProfile["department"];
// SPQuery CAML stuff here
这篇关于Sharepoint列表按配置文件属性过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!