Solved

List of Roles

Posted on 2000-04-10
8
205 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

16 Experts available now in Live!

Get 1:1 Help Now