Checking Role Membership?

How can I check if a name stored in a document e.g. Staff Member is a member of one of the database roles? So it is not the current user I am comparing against the role but a name in a field in the document? Thanks.

Subject: Checking Role Membership?

You can do it thru LotusScript:This will list the roles for a specified person.

This sample is from the Notes Help file:

Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( “Bob Kidder/East/ACME” )
Forall r In entry.Roles
Messagebox( r )
End Forall

Subject: Checking Role Membership?

Andrew is right about how to do it in Lotus script, but you didn’t specify the tool you are using. In formula, look at the @UserRoles function.

Subject: Checking Role Membership?

You want the QueryAccessRoles method.

Excerpt from Designer help:

Returns the roles of a person, group, or server in a database.

Note This method is new with Release 6.

Defined in

NotesDatabase

Syntax

roles = notesDatabase.QueryAccessRoles( name$ )

Parameters

name$

String. The name of the person, group, or server.

Return value

roles

String array.

If the name has roles, each element of the array contains one role.

If the name has no roles, the array has one element that contains an empty string.

Usage

If the name you specify is listed explicitly in the ACL, then QueryAccessRoles returns the roles for that ACL entry and does not check groups.

If the name you specify is not listed explicitly in the ACL, QueryAccess checks to see if the name is a member of a group in the primary address book where the program is running: on a workstation the Personal Address Book; on a server the Domino Directory.