@UserRoles (Formula Language)

For a database on a server or a local replicated database, returns a list of roles that the current user has. Roles are defined in a database's access control list.

Syntax

@UserRoles

Return value

roles

Text list. Each item in the list is the name of a role that the current user has in the current database. The role names are enclosed in brackets. Returns an empty string ("") if the current database is local and not a replication.

Usage

This function does not work in column, selection, mail agent, or scheduled agent formulas.

Only roles explicitly assigned to the current user are returned. Roles assigned to a group which includes the current user are not returned.

@UserRoles appends $$WebClient to the list of roles when a Web user opens a database.

@UserRoles returns a subset of the information returned by @UserNamesList.

Examples

  1. This example displays the roles assigned to the current user. The roles are displayed in brackets.
    @UserRoles
  2. This code, if added to the New Document action button of a database that has the Enforce a consistent ACL across all replicas checkbox selected on the Advanced tab of the ACL Properties box, opens the Manager form if the [Manager] role is assigned to the current user; otherwise it open the Employee form in a Notes® application.
    @Command([Compose];"";@If(@IsMember("[Manager]";@UserRoles);"Manager";
    "Employee"))
  3. This subform formula selects a different subform depending on whether the user is a Web client or not. The WebClient role is a role that is automatically created by Notes/Domino; it does not require the surrounding brackets, but does require the leading double dollar signs.
    @If(@IsMember("$$WebClient"; @UserRoles); "WebSubform"; "NotesSubform")