Subject: RE: give roles to the users from a form
I think you need to ask your question more precisely. What prevents you from doing what you want?
Do you want to update the ACL instead of saving the document, or in addition to saving the document?
Is the person editing the document always a manager of the database? (i.e. do they have access themselves to update the ACL?)
Must the ACL update happen immediately, or will a few minutes later be soon enough? What about an hour later?
Why are you doing this instead of just using File / Database / Access Control in the Notes client?
Will you have only individual usernames in the database ACL, or will you use some groups? If you have many users with roles, it’s generally better to use a group document in the Domino directory, and put the group name in the ACL. If you do that, you should not necessarily expect to find the user’s name in the ACL. You might need to edit the membership of a group instead of making a change to the ACL. You can do that with LotusScript, but the code is more complicated.
If you don’t find the username in the ACL, do you want to add it?
All of these questions are important in finding the best answer to your question.
Sub Postsave(Source As NotesUIDocument)
Dim doc As NotesDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As notesacl
Dim strName As String, strLevel As String
Dim entryacl As notesaclentry
Set doc = Source.Document
strName = doc.GetItemValue(“fieldname”)(0)
strLevel = doc.GetItemValue(“anotherfieldname”)(0)