Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

List of Roles

Posted on 2000-04-10
8
Medium Priority
?
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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 150 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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