Web 部件:模拟/RunWithElevatedPrivileges
我正在使用 MOSS 07 & WindowsServer2003 上的 VisualStudio 07 (c#)
我的问题是我想要从一个 Sharepoint 访问另一个 Sharepoint。 在SharePoint_1中有一个SPList,我想从SharePoint_2中读出。
我的研究结果是 IMPERSONATION 和 RUN_WITH_ELEVATED_PRIVILEGES。 通过模拟我可以读出我所连接的SPSite的html代码,但是我怎样才能得到我想要的列表呢? 当我尝试 RunWithElevatedPrivileges 时,我必须从 SharePoint_1 的网站获取用户。但由于 FileNotFoundException,我无法获取用户(即使我知道了他的名字)。
我该如何解决这个问题?
谢谢
有件事我忘记告诉了。 列表中有附件,我也需要访问它们。
解决这个问题的最佳方法是什么? 希望这不是很棘手,因为我 5 周前第一次使用 Sharepoint,感觉不太熟悉:)
谢谢
I am using MOSS 07 & VisualStudio 07 (c#) on a WindowsServer2003
My Problem is that I want to have access from one Sharepoint to another.
In SharePoint_1 is a SPList I want to read out from SharePoint_2.
The results of my research are IMPERSONATION and RUN_WITH_ELEVATED_PRIVILEGES.
With impersonation I can read out the html code of the SPSite I am connected with, but how can I get the List I want?
When I try to RunWithElevatedPrivileges I have to take a user form the site of SharePoint_1. But I cant get the User (even if I got his name) because of a FileNotFoundException.
How can I solve the problem?
Thanks
There is something I forgot to tell.
In the List are Attachments and I need access to them, too.
What would be the best way to solve this issue?
Hopefully its not very tricky, because I used Sharepoint 5 weeks ago the first time and dont so feel very familiar with it :)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 SPSecurity.RunWithElevatedPrivileges 时无需指定用户。 就可以了
我认为如果您使用: [url] = 指向其他网站集的 url
You dont need to specify a user when using SPSecurity.RunWithElevatedPrivileges. I think you will be ok if you use:
[url] = url to the other site collection