We have a Supervision database in which supervision notes are recorded and then approved by both supervisor and supervisee. The approving is done by buttons which put the usernames in their respective “Approved By” fields. When both parties have approved the document it is supposed to be no longer editable or deletable.
Supervisees have Author access to the database, and it is they who create the supervision documents, so I would do this with an Authors field except for the fact that managers have Editor access to the database because they have to have access to multiple staff supervision docs, so the Authors route doesn’t work to keep them out.
Is there an easy (or a hard) way of making the approved documents read-only to everyone and undeletable?
Subject: How to make a document read-only even by Editors
Create a role called Admin for example.
Only those who have this role enable can edit the documents.
In the QueryModeChange section place the following code
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( session.CommonUserName )
If entry Is Nothing Then
Set entry = acl.GetEntry( session.UserName )
End If
If entry.IsRoleEnabled( "[Admin]" ) Then
Continue = True
Else
Msgbox "Must be a supervisor to change"
Continue=False
End If
Subject: RE: How to make a document read-only even by Editors
once you make this change in your TEMPLATE, replace the design of your production database and choose to hide the design lest some wise person run the debugger and stop executing the querymodechange script.
Subject: RE: How to make a document read-only even by Editors
Unfortunately, modifying the Querymodechange event in this way will only stop them from changing the edit mode while using the form that you have created. There are many, many ways for a determined user to get around this.
Is there a reason that you cannot use multi-value Authors fields, with both the document creators and the Supervisors that need access listed in them (by role perhaps)? Anyone listed in an Authors field has the ability to modify a document; not just the creator of it. This would allow your Supervisors to modify any documents they need to, without needing more than Author level access to the database.