我希望能够让所有用户创建表单(QCR),但除了我和另一个用户之外,没有人应该能够编辑该表单。我一直在修改ACL和作者和读者领域,但没有运气。在Lotus Notes表单中限制访问
更多背景信息: 1.此表单是通过单击单独数据库中的按钮创建的,因为此QCR表单中的某些信息是从该数据库继承的。 2. All组中的用户应该能够创建此表格 3.用户应该能够读取QCR数据库中的所有文档,但不能编辑它们 4.我和另外一个用户应该能够读取和编辑的所有文件 5.有在QuerySave的事件前,一个文件正在编辑
后比较值的一些代码我曾尝试: 我创建了一个组QCR_Access有我和其他用户1作为成员。然后我创建了一个作者字段,用'QCR_Access'作为QCR表格中的公式计算出来。但是,无论我给所有组(存储者或作者)提供什么类型的访问类型,每当我尝试使用ALL组中的一个用户保存数据库中的新文档时,应用程序都会给我提供错误。
以下是Querysave中的代码,可能会帮助您了解我在做什么。
Sub Querysave(Source As Notesuidocument, Continue As Variant)
' Compare the values in the form after it is saved with its original values when the document is not a new document.
Dim doc As NotesDocument
Set doc = Source.Document
Dim session As New NotesSession
Dim user As String
user = session.CommonUserName
If newDoc Then
doc.Log_Date = Cstr(Now())
doc.Log_User = user
doc.Log_Actions = "New document created."
Else
' Load fields value to the array
lastValues(0) = doc.QCR_Requestor(0)
lastValues(1) = doc.QCR_No(0)
...
lastValues(31) = doc.QCR_Tracking_Info(0)
' Compared each value in the array to see if there is any difference
Dim i As Integer
For i = 0 To 31
If lastValues(i) <> originalValues(i) Then
Call UpdateLogFields(doc,user,i)
End If
Next
End If
End Sub
Sub UpdateLogFields (doc As NotesDocument, user As String, i As Integer)
Dim logDate As NotesItem
Dim logUser As NotesItem
Dim logActions As NotesItem
Set logDate = doc.GetFirstItem("Log_Date")
Set logUser = doc.GetFirstItem("Log_User")
Set logActions = doc.GetFirstItem("Log_Actions")
' a space is needed otherwise the appended text is right next to the border
Call logDate.AppendToTextList(" " & Cstr(Now()))
Call logUser.AppendToTextList(" " & user)
Select Case i
Case 0: Call logActions.AppendToTextList(" Requestor is changed.")
Case 1: Call logActions.AppendToTextList(" QCR No is changed.")
...
Case 30: Call logActions.AppendToTextList(" Follow Up information is changed.")
Case 31: Call logActions.AppendToTextList(" Tracking information is changed.")
End Select
End Sub
这是更好的方法。角色意味着如果名称/组更改(只有ACL),则不必在以后更改代码。 – 2012-02-29 19:09:03