On DB launch/open I want to make the content selective.
If the person has the “[Admin]” role I want a certain frameset to open
If not the person’s individual doc should open(there is a doc in the DB for each user already created).
I stabbed at having the DB open a page and have LS do that logic. Which was close but the page always open with a view and I cant close it. The PostOpen code does open the frameset or doc I want to open just dont want the page up as well.
Im guessing Im going about this all wrong. Or its just a bad idea.
for the DB Launch tab in the DB properties I have it set to “Open a designated Navigator”
Navigator type is “Page” and I selected a blank page I made.
In the PostOpen event of the page I did this:
Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim adminList As Variant
Dim contactsView As NotesView
Dim currView As NotesUIView
Dim personDoc As NotesDocument
Set currView = ws.CurrentView
Redim adminList(0)
adminList(0) = "[Admin]"
If isAdmin(adminList) Then
'open the default view
Call ws.OpenFrameSet("notes6FS")
Else
Set db = session.CurrentDatabase
Set contactsView = db.GetView("LUbyCN")
Set personDoc = contactsView.GetDocumentByKey(session.UserName)
If Not personDoc Is Nothing Then
Call ws.EditDocument(False, personDoc)
Else
Call ws.OpenFrameSet("notes6FS")
End If
End If
Call currView.Close
End Sub
isAdmin is in a script library that scrolls through the users roles and returns true if any of the passed in values are in that list. So I pass in Admin and it returns true if the user is an Admin.