我正在使用表单身份验证登录到 windows sharepoint servicevices 3.0 服务。我需要在匿名访问期间提升将记录添加到共享点门户列表的权限。
我在 msdn 中找到了线索:http: //msdn.microsoft.com/en-us/library/bb466220%28classic%29.aspx
但这对我不起作用。:( 它仍然要求用户登录和密码。
有人可以帮我吗?
Public Function AddUserAccountData() As String
SPSecurity.RunWithElevatedPrivileges(AddressOf AddUserAccountDataToSPList)
Return ""
End Function
Private Sub AddUserAccountDataToSPList()
Dim oSharedConfig As SharedConfig = SharedConfig.Instance
Dim sListName As String = oSharedConfig.oWebPartsOpt.UserOpt.AccountVerificationList.Name
Using oSite As SPWeb = SPContext.Current.Web
Dim oUserAccStatusList As SPList = oSite.Lists(sListName)
oUserAccStatusList.Items.Add()
Dim oSPListItem As SPListItem = oUserAccStatusList.Items.Add()
oSPListItem("one") = _sUserLogin
oSPListItem("two") = _sUserGuid
oSPListItem("three") = False
oSPListItem("four") = DateTime.Now
oSPListItem.Update()
End Using
End Sub