LS Function to get ACL entries have have a role enabled

Here's a simple LS function that returns a list of ACL entries that have a specific role enabled:

Function GetEntriesByRole(rolestring As String) As String
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim acl As NotesACL
  Dim aclentry As NotesACLEntry
  
  On Error Goto errorproc
  
  Set db = session.CurrentDatabase
  Set acl = db.ACL
  Set aclentry = acl.GetFirstEntry
  
  While Not(aclentry Is Nothing)
  If aclentry.IsRoleEnabled(rolestring) Then
    If GetEntriesByRole = "" Then
     GetEntriesByRole = aclentry.Name
    Else
     GetEntriesByRole = GetEntriesByRole & "~|~" & aclentry.Name
    End If
   End If
   
   Set aclentry = acl.GetNextEntry(aclentry)
  Wend
  
finish:
  Exit Function
  
errorproc:
  Call LogError()
  Resume finish
 End Function

The list of acl entries is returned in a string that uses "~|~" to separate the multiple entries.  You can use the Split function to expand the list into an array.  The role passed must contain the [] charaters.

<< Previous Document / Next Document >>
    Be the first in the world to comment on this entry!!!
Post A Comment
Subject: (required)
Name: (required)
Email: (required)
Web Site:
Comment:(No HTML - Links will be converted if prefixed http://)

Remember Me?