如何使用自定义帐号模拟创建SharePoint2007站点,使其不显示登录提示框
发布于 2010-06-03 19:50:37
在传递SPUserToken对象的地方使用SPSite构造函数来获取某个用户的令牌,使用SPWeb.AllUsers"userLoginName".UserToken
发布于 2010-06-04 17:06:50
我认为,为了能够获取用户令牌,您应该以提升的权限运行您的代码,这可能就是为什么pompting for login (因为匿名用户没有权限获取另一个用户的令牌)
示例
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//is important that you instantiate your SPSite object within you elevated code
using (SPSite oSite = new SPSite("your site URL"))
{
using (SPWeb oWeb = "your web")
{
//your code to run elevated
}
}
});
https://stackoverflow.com/questions/2965215
复制相似问题