Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Using Roles to Populate a Field

Posted on 2004-11-30
Medium Priority
Last Modified: 2013-12-18
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?
Question by:Jaziar
  • 3
LVL 14

Expert Comment

ID: 12706397
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

Author Comment

ID: 12706487
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.
LVL 31

Accepted Solution

qwaletee earned 500 total points
ID: 12706647
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:

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.

Author Comment

ID: 12706706
There will be no groups in this database - only Roles

Author Comment

ID: 12706839
That Rocks - Thank You and Job Well Done

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

564 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