Sample Code Snippet to Handle User Security Updates via "LS back-end" (Hack) ... get/add binder ... ... set binder profile fields ... ... get security and test for issecured ... ' set flags to set manually theBinderSecurity.AllEditorsFlag = False theBinderSecurity.AllReadersFlag = False ' save and checkin binder Call theBinder.Save Call theBinder.CheckIn(2, "Added by API.") whereami = "Checked-in binder " & bdbindertitle & "." Call uiDoc.FieldAppendText("CS_Log", whereami & Chr$(13) & Chr$(10)) Print whereami ' since setting user security still doesn't work reliably (since vs. 2.5) and still cannot expand groups, we need to complete this via back-end bunid = theBinder.UniversalId bdbrepid = theCabinet.BinderDatabase Set bDb = New NotesDatabase("", "") If (bDb.OpenByReplicaID(db.Server, bdbrepid)) Then ' database found & opened, get binder doc Set bDoc = bDb.GetDocumentByUNID(bunid) If Not (bDoc Is Nothing) Then ' found binder doc, update security ' - DocManagers, DocAuthors, DocReaders - datatype is Text/Text List. Store names in Abbreviated format. ' - ComputedManagers (Authors datatype), ComputedAuthors, ComputedReaders - (Readers datatype) ' (this script does not implement Manager fields) ' DocReaders tmpcounter = 0 Forall usernm In bdReadersItem.Values curnm = NotesNameReformat(Cstr(usernm), 2) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall Call bDoc.ReplaceItemValue("DocReaders", tmpLst) ' ComputedReaders tmpcounter=0 Forall usernm In bdReadersItem.Values curnm = NotesNameReformat(Cstr(usernm), 1) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = "[Administrator]" ' add role to list Call bDoc.ReplaceItemValue("ComputedReaders", tmpLst) ' DocAuthors tmpcounter = 0 Forall usernm In bdAuthorsItem.Values curnm = NotesNameReformat(Cstr(usernm), 2) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall Call bDoc.ReplaceItemValue("DocAuthors", tmpLst) ' ComputedAuthors tmpcounter = 0 Forall usernm In bdAuthorsItem.Values curnm = NotesNameReformat(Cstr(usernm), 1) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall Call bDoc.ReplaceItemValue("ComputedAuthors", tmpLst) ' DocManagers tmpcounter = 0 ' part 1, get existing values Set bMgrItem = bDoc.GetFirstItem("DocManagers") Forall mgrnm In bdAuthorsItem.Values curnm = NotesNameReformat(Cstr(mgrnm), 2) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall ' part 2, add new values Forall usernm In bdManagersItem.Values curnm = NotesNameReformat(Cstr(usernm), 2) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall Call bDoc.ReplaceItemValue("DocAuthors", tmpLst) ' ComputedManagers tmpcounter = 0 ' part 1, get existing values Set bMgrItem = bDoc.GetFirstItem("ComputedManagers") Forall mgrnm In bdAuthorsItem.Values curnm = NotesNameReformat(Cstr(mgrnm), 1) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall ' part 2, add new values Forall usernm In bdManagersItem.Values curnm = NotesNameReformat(Cstr(usernm), 1) Redim Preserve tmpLst(tmpcounter) As String tmpLst(tmpcounter) = curnm tmpcounter=tmpcounter + 1 End Forall ' (don't need to append role [Administrators], already in original loaded list) Call bDoc.ReplaceItemValue("ComputedAuthors", tmpLst) ' save updated security Call bDoc.Save(True,False) whereami = "Updated binder " & bdbindertitle & " with back-end security update." Call uiDoc.FieldAppendText("CS_Log", whereami & Chr$(13) & Chr$(10)) Print whereami Else ' unable to retrieve binder doc for backend security update whereami = "Unable to retrieve binder document for back-end security update." Call uiDoc.FieldAppendText("CS_Log", whereami & Chr$(13) & Chr$(10)) Print whereami End If Else ' unable to retrieve binder database whereami = "Unable to retrieve binder document's database for back-end for security update." Call uiDoc.FieldAppendText("CS_Log", whereami & Chr$(13) & Chr$(10)) Print whereami End If