Manage Learn to apply best practices and optimize your operations.

How To Find All Persons (In Acl) Which Have A Specific Role

This function allows to find all personns in the db's ACL which have a specific
role
Function WhosRole( sRole As String) As Variant

' This function browse the entire ACL for
' retrieving all personns who have the role
' passed in the parameter "sRole"

' It returns an array, filled with the names,
' or with the first element blank if no one has
' this role

' BACKEND objects Declaration
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry

' Variables Declaration
Dim cpt As Integer
Dim sResult As String
Dim TabDest() As String

If sRole = "" Then

Beep
Messagebox "Parameter <&LTRole>> is required for the WhosRole function"

Else

Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetFirstEntry

sResult = ""
cpt=0
Do Until entry Is Nothing
If entry.IsRoleEnabled( sRole ) Then
Redim Preserve TabDest(cpt)
TabDest(cpt)=Entry.name
cpt=cpt+1
End If
Set entry = acl.GetNextEntry( entry )
Loop

If cpt = 0 Then
Beep
Messagebox "Sorry, nobody has the role " & sRole & " in this database
ACL", 16, "ACL Error"
Redim Preserve TabDest(0)
TabDest(0) = ""
End If

WhosRole = TabDest

End If

End Function

Dig Deeper on Domino Resources - Part 5

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

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

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close