Manage Learn to apply best practices and optimize your operations.

Restrict Field Edit Access Based On Roles

Many companies list groups in their ACLs instead of individuals making it
difficult to evaluate user roles. This code is triggered from the Entering
event on a field allowing you to Evaluate groups to see if a role is enabled
and therefore if that individual is authorized to edit a field.

This code is placed in the Entering event.

Note! You may want to Enforce a Consistent ACL Across All Replicas as an added
security feature.
Sub Entering(Source As Field)

Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument
'Checks to see if you are a member of a group assigned the role

Roles = Evaluate(|@isMember("[RoleName]";@UserRoles)|)

If Roles(0) = 1 Then
'if yes, the code does nothing
Exit Sub
'if no, you are kicked to the top of the document
Msgbox "You are not authorized to enter information in that field" ,
16 , "Warning"
Call uidoc.GotoTop
End If

End Sub

Dig Deeper on Domino Resources - Part 4

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...