Solved

List of Roles

Posted on 2000-04-10
8
206 Views
Last Modified: 2013-12-18
Hi experts,

How can I get a list of Members of a certain UserRole I use in the ACL of a database ?

Greetings Bob !!!
0
Comment
Question by:oosterbaan
8 Comments
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 2700769
As far a I know you can't. I am in the same position since I want to send an e-mail to all members of a certain role. I think I am going to create a loop which will iterate through each member of the ACL and check to see if they are a member of that role. However I would like to avoid using LotusScript to do this, but I can't find a function which will give me the members of the ACL.

Any ideas?

Zaphod.
0
 
LVL 2

Expert Comment

by:mchampou
ID: 2703935
Z beeblebrox : do all the persons who have the role are at the same Access Level ? If so, why don't you simply create a group in your Public Address Book and put their names in there. Then, just add the group to your ACL (with the role if need be) and then use the group name for your maillings ?

I would understand if you were to tell me that the option does not apply to your case.

Just for the fun of it, I'm coding something that will do what you want, just give me a couple of hours (can't do it at the same time I'm working).

Mchampou
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 2703969
What you suggest is of course possible, but it is much easier to maintain a list in the ACL of the database, rather than in the PAB. We have too many groups as it is in the PAB so creating a group with one member isn't the greatest. What I don't understand is why there isn't a function do to this, it seems like such a reasonable and standard thing to be doing.

Oh well,

Thanks,

Zaphod.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 2712443
Hi,

I give up on the @function approach. The following script which I got out of the help file populates a field with the names of all people with a certain role.

Zaphod.    



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
Dim foundRole As Variant
Dim sendMailTo As String
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
Set acl = db.ACL
roleName = "[Tech Coord]"
foundRole = False
' check to see if the role exists in the database
Forall r In acl.Roles
   If ( r = roleName ) Then
      foundRole = True
      Exit Forall
   End If
End Forall
If ( foundRole = False ) Then
   Messagebox _
    ( "Error, " & roleName & " is not a role" )
' if the role exists, check each acl entry to see if role
' is enabled for entry
' if so, add entry name to the People field
' on the current document,
' followed by a semicolon, the multi-value separator
     Else
          Set entry = acl.GetFirstEntry
          While Not ( entry Is Nothing )
               If ( entry.IsRoleEnabled( roleName ) = True ) Then
                    sendMailTo$ = sendMailTo$ & "; " & entry.Name
               End If
               Set entry = acl.GetNextEntry( entry )
          Wend
     End If
     Call uidoc.FieldSetText("TechCoord", sendMailTo$)
     
     Call uidoc.Refresh
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:DButler
ID: 2749665
Don't forget to account for groups in the ACL.  You'd need something [?dangerously?] recursive to cover the possibility of groups within groups -- not to mention (in a multi-domain environment with potentially disconnected users) a reliable way of finding and opening the right public NAB.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 2751341
Generally that should not be an issue since you can do authentication, send e-mails, assign security, etc by groups, not just by names. So if the script runs Group1 as a member of the [Tech Coord] role then I can still use that group name in Reader fields or in the SendTo of an e-mail. I can't, off the top of my head, think of a reason inside notes that you would need to have a list of the actual names. The only place you might want such a thing would be if you wanted to display a list of names or something similar. If this is necessary then you would have to determine if a given member was a group (I don't know how you do this) then look up the address book to grab all of the members of that group. You would then of course have to check to see if any of those were groups. This is where DButler's comment regarding dangerously comes in. If group2 is a member of group1 and group1 is a member of group2, you can easily get into an infinite loop, so checks for things like this would be necessary.

Hopefully though, none of that is necessary.

Zaphod.
0
 
LVL 1

Author Comment

by:oosterbaan
ID: 2754276
Hi guys,

I have tried your script Z Beeblebrox, but i can't fill the value of a readersfield with a script, only with Formula language. What am I doing wrong?

Greetings Bob !!!
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 50 total points
ID: 2755295
You can't put a script as for the default value or the computed value. You need to put this script in the postopen event of the form and it will populate the TechCoord field with the names of everyone with the [Tech Coord] role. The TechCoord field must be editable or the script will not be able to change the value.

Give it a try,

Zaphod.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus notes VB code 4 206
Only send email if contains "abcd" 3 145
Lotus notes - Follow up notes mail missing 15 68
LotusScript: Merge Data to Word File 22 81
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now