Sharepoint列表按配置文件属性过滤 [英] Sharepoint List Filter by Profile Property

查看:162
本文介绍了Sharepoint列表按配置文件属性过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过当前用户的配置文件属性筛选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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆