queryAccessRoles (NotesDatabase - JavaScript™)
Returns the roles of a person, group, or server in a database.
Defined in
NotesDatabaseSyntax
queryAccessRoles(name:string) : java.util.Vector
Parameter | Description |
---|---|
name |
The name of the person, group, or server. For a hierarchical name, the full name must be specified but can be in abbreviated format. |
Return value | Description |
---|---|
java.util.Vector |
A vector with elements of type string.
|
Usage
If the name you specify is listed explicitly in the ACL, thenqueryAccessRoles
returns the roles
for that ACL entry and does not check groups.If the name you specify
is not listed explicitly in the ACL, queryAccessRoles
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.
Examples
This computed field displays the roles of the current user for the current database.var title:string = database.getTitle();database
title = "For database \"" + title + "\" you have the following access roles: ";
var roles = database.queryAccessRoles(session.getUserName());
if (roles.isEmpty()) {
return title + " none";
} else {
for (var i=0; i<roles.length; i++) {
title = title + " " + roles[i];
}
return title;
}