Using Roles to Populate a Field

I have a field in my form that I would like to be populated from the ACL role assignments.

I want the user to be able to select a name from a list that is populated from the ACL roles assignments.

Is this Possible?
JaziarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

p_parthaCommented:
You have to use Notesacl class for this :

Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Set db = session.CurrentDatabase
Set acl = db.ACL
Forall r In acl.Roles
  Messagebox( r )
End Forall
0
JaziarAuthor Commented:
p partha That gives me the roles, which is good.  But I need to list the users assigned to the roles in a field.

Joe Smith        role = DE
James White    role = PE

I would like the field to get all the users that are in the role of PE.  The role will be static in the formula.

so the value of the field would be James White

You may have laid it out for me, but I am just missing it.
0
qwaleteeCommented:
Yes,possible.  You really need to hings:

1) ALlow user to pick a name from the ACL
2) Have something pick up the role(s) associated with the selected name.

...although there is one caveat.

First, add a field to the form called NameFromACL, computed when composed, value ""
Second, add a field called RolesForACLName, allow multiple values, computed when composed, value ""
Third, add a button labeled "ACL Roles" with the following formula:
@DialogBox("ACLRolePicker")

Next, create a subform.  Copy the same two fields to the subform.
Change the first field (NameFromACL) to type Dialog List, choices frmo ACL, enable refresh fields on keyword change.
Hide the second field.
Then, put the following code in the QueryClose of the subform:
    source.Document.ReplaceItemValue "RolesForACLName" , source.Document.parentDatabase.acl.getEntry(Source.FieldGetText("NameFromACL")).roles


Caveat: An entry in the ACL can also be a group member of a group that is also listed in the ACL.  In that case, this may miss roles of the parent group.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JaziarAuthor Commented:
There will be no groups in this database - only Roles
0
JaziarAuthor Commented:
That Rocks - Thank You and Job Well Done
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.