【问题标题】:Edit Web Part - HTTP 403 Forbidden Error编辑 Web 部件 - HTTP 403 禁止错误
【发布时间】:2013-01-07 14:47:53
【问题描述】:

我在 SharePoint 2007 网站中有一个 Web 部件。此 Web 部件是用 对象模型代码 编写的。我获得了对此网站集的完全控制权,并且可以毫无问题地访问该页面。

当我尝试通过单击“站点操作--> 编辑页面”来编辑它时,出现以下错误

Error:
The website declined to show this webpage- HTTP 403

Most likely causes:

•This website requires you to log in.
 What you can try:

Go back to the previous page. 


**More information**

This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.

For more information about HTTP errors, see Help.

【问题讨论】:

  • 是访问文件系统路径的用户控件还是类似的东西?

标签: sharepoint-2007


【解决方案1】:

是访问文件系统路径的用户控件还是类似的东西?

如果是,那么您必须使用 SPSecurity.RunWithElevatedPrivilages(delegate() {})。

Have a look at this

谢谢

【讨论】:

  • 是的,它有 ASP .Net 用户控制。此外,webpart 代码包含访问本地文件系统以获取 xml 配置文件和用于记录的日志文件的代码。另外,我在 Web 部件代码中使用了这个 SPSecurity.RunWithElevatedPrivilages(delegate() {})。但 Web 部件仍然不可编辑。
【解决方案2】:

我解决了 HTTP 403 Forbidden 问题。问题的根本原因是,在我的代码中,可以访问服务器上的文件系统,而登录的用户在编辑 Web 部件时无权访问。

我使用了 RunWithElevatedPrivileges,但仅用于获取站点信息和更新列表。读取配置文件并登录到日志文件的代码不在 ElevatedPrivileges 范围内。

我将它们包含在提升的权限中,用户可以编辑 web pat。我们还可以通过将特定文件的读、写权限授予“SERVER\USERS”来解决此问题

【讨论】:

    猜你喜欢
    • 2011-07-12
    • 2018-01-14
    • 1970-01-01
    • 2021-10-10
    • 1970-01-01
    • 2016-06-20
    • 2018-05-15
    • 2016-05-22
    • 1970-01-01
    相关资源
    最近更新 更多