List all user name belong to specifed role or group

Hi ,

I would like to list name of all user belong to selected role … I would like to use combo box field to drop list all names with the selected role …

note : server rel. 5

thanks and regards

Subject: list all user name belong to specifed role or group

In your database, create a form called “ACL Report Roles” with the following fields:

showLevels - text - hidden

showLevelsDisplay - text - visible - computed with the showLevels field as the default value

Create an action in a view, with this code:

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim session As New NotesSession

Dim db As NotesDatabase

Dim acl As NotesACL

Dim entry As NotesACLEntry

Dim roleName As String





Set uidoc = workspace.CurrentDocument

Set db = session.CurrentDatabase

Set acl = db.ACL	

Set uidoc = workspace.ComposeDocument("","","ACL Report Roles")

inx = 0



Forall r In acl.Roles

	Set entry = acl.GetFirstEntry

	roleName = Cstr(r)

	Call uidoc.FieldAppendText("showLevels",  "Role Name: " & roleName & "  -  Users w/ this role:" & Chr(10))	

	While Not ( entry Is Nothing )		

		If entry.IsRoleEnabled( roleName ) Then

			temp = Strright(entry.Name, "CN=")

			temp = Strleft(temp, "/O=")

			Call uidoc.FieldAppendText("showLevels",  temp & Chr(10))				

		End If

		Set entry = acl.GetNextEntry( entry )			

	Wend		

	Call uidoc.FieldAppendText("showLevels", Chr(10))		

End Forall



Call uidoc.Refresh	

End Sub

Run the action.