Manage Learn to apply best practices and optimize your operations.

Control Access Of Views

Very often, we use a navigator to link to views of a database so as to provide
a more user friendly interface for the users. Some of these views may only be
read-accessible by the users with certain roles, say DBManager role. If we set
the view access to restrict user read access only for users with DBManager
role, other users will encounter an error message 'view does not exist' when
they click on these views on the navigator. To resolve this, we can use
@UserRoles to determine the role of the user and issue a more user-friendly
message 'You are not authorised to access this option.'

If we use the open database launch option 'open designated navigator in its own
window', @UserRoles will only work for R4.6x and above. For R4.5x and below,
@UserRoles will be empty as the database is not fully opened yet. To resolve
this problem, we can put the following Script(A) in PostOpen event of Database
Script, to pass down an environment variable, and retrieve it from the
navigator using Formula(A).
Script(A) :
Sub Postopen(Source As Notesuidatabase)
Dim Session As New NotesSession
Dim URole As Variant
Dim MyRole As String
URole = Evaluate("@UserRoles")
MyRole = ""
Forall ur In URole
If ur = "[DBManager]" Then
MyRole = "DBManager"
End If
End Forall
Call Session.SetEnvironmentVar("LoginUserRoles", MyRole)
End Sub

Formula(A) : In the Navigator, determine role before opening a view
GetUserRoles := @Environment("LoginUserRoles");
@If(GetUserRoles != "DBManager"; @Return(@Prompt([OK]; "Not Authorised"; "You
are not authorised to access this option.")); @Command([OpenView]; "DBMgr
View"))

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close