SharePoint【学习笔记】-- SharePoint 权限提升和杜绝当前上下文环境影响

权限提升的方式:

SPSecurity.RunWithElevatedPrivileges(delegate() { ListItem.Web.AllowUnsafeUpdates = true; ListItem["ZhDocID"] = DocID; ListItem["ZhDocDescription"] = DocDescription; ListItem["ZhIsControlled"] = DocIsControlled; ListItem["ZhDocStatus"] = DocStatus; ListItem["ZhDocIssuedStatus"] = DocIssuedStatus; ListItem["ZhDocIssuedTime"] = DocIssuedTime; ListItem["ZhDocSignInTime"] = DocSignInTime; ListItem["ZhDocSURL"] = DocSURL; string strZhDocIssuedDetails = ""; if (DocStateInBMList != null && DocStateInBMList.Count > 0) { strZhDocIssuedDetails = string.Join(";", DocStateInBMList.ToArray()); } ListItem["ZhDocIssuedDetails"] = strZhDocIssuedDetails; ListItem.SystemUpdate(); }); 

 

你可能感兴趣的:(SharePoint)