最近、SharePoint で使用する AJAX Web パーツの作成を開始しましたが、奇妙なエラーが発生しています。EnsurePanelFix() が原因で Web パーツが 401 エラーをスローしているようです。ログには、401.2 と 401.3 の両方のエラーがほぼ同時に表示されています。ここや他のいくつかのサイトで少し調査した後、EnsurePanelFix() にいくつかの変更を加えました。現在、次のようになっています。
void EnsurePanelFix
{
// Change AJAX doPostBack behavior to fix the update panel.
if (this.Page.Form != null)
{
String fixupScript = @"
if (typeof(_spBodyOnLoadFunctionNames) !== 'undefined'){
_spBodyOnLoadFunctionNames.push(""_initFormActionAjax"");
function _initFormActionAjax() {
if (_spEscapedFormAction == document.forms[0].action){
document.forms[0]._initialAction =
document.forms[0].action;
}
}
RestoreToOriginalFormAction = function() {
if (_spOriginalFormAction != null) {
if (_spEscapedFormAction==document.forms[0].action){
document.forms[0].action=_spOriginalFormAction;
}
_spOriginalFormAction=null;
_spEscapedFormAction=null;
document.forms[0]._initialAction = document.forms[0].action;
}
};
}";
string scriptKey = "UpdatePanelFixup";
if (!Page.ClientScript.IsClientScriptBlockRegistered(scriptKey))
ScriptManager.RegisterStartupScript(this, typeof(SpecDatabaseViewer), scriptKey, fixupScript, true);
ScriptManager.RegisterStartupScript(this,
typeof(SpecDatabaseViewer), "UpdatePanelFixup",
fixupScript, true);
}
セキュリティ ログを見ると、失敗が次のように記録されていることがわかります。
Event Type: Failure Audit
Event Source: Security
Event Category: Object Access
Event ID: 560
Date: 1/6/2010
Time: 11:46:34 AM
User: NT AUTHORITY\NETWORK SERVICE
Computer: SHAREPOINT
Description:
Object Open:
Object Server: SC Manager
Object Type: SERVICE OBJECT
Object Name: WinHttpAutoProxySvc
Handle ID: -
Operation ID: {0,69477107}
Process ID: 404
Image File Name: C:\WINDOWS\system32\services.exe
Primary User Name: SHAREPOINT$
Primary Domain: SPDOMAIN
Primary Logon ID: (0x0,0x3E7)
Client User Name: NETWORK SERVICE
Client Domain: NT AUTHORITY
Client Logon ID: (0x0,0x3E4)
Accesses: Query status of service
Start the service
Query information from service
Privileges: -
Restricted Sid Count: 0
Access Mask: 0x94
複数の障害監査があり、それらの間で唯一異なるデータは操作 ID です。
このコードがなくてもすべてが正常に機能することを考えると、認証またはファイル許可の問題が発生する理由は誰にもわかりますか? ありがとう。
編集: ACL と関係があることは確かですが、どのリソースが問題を引き起こしているのかをどこで探すべきか正確にはわかりません。