The problem with @UserRoles is that it will only return to you the Roles the current user has within the database in which the code is running. This is true for both Formula language and Evaluate command from LotusScript when evaluating the @UserRoles command.
Contrary to this posting, however:
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/702a9c8efe8df65c85256b8300607f8a?OpenDocument
when performing an Evaluate on @UserRoles, the document passed in as the 2nd parameter does affect the result of the command. This is particularly useful if your LotusScript is executing within the context of one database but you need to evaluate your role in another.
Here is some example code:
Sub Initialize
Dim ses As New NotesSession
Dim db1 As NotesDatabase
Dim db2 As NotesDatabase
Dim doc1 As NotesDocument
Dim doc2 As NotesDocument
Dim tempVar As Variant
Set db1 = ses.GetDatabase("ServerName", "OneRole.nsf", False) 'In this db, I have role [One]
Set db2 = ses.GetDatabase("ServerName", "TwoRole.nsf", False) 'In this db, I have role [Two]
If db1.IsOpen and db2.IsOpen Then
Set doc1 = db1.CreateDocument
Set doc2 = db2.CreateDocument
tempVar = Evaluate({@Implode(@UserRoles; ";")}, doc1)
Msgbox tempVar(0)
tempVar = Evaluate({@Implode(@UserRoles; ";")}, doc2)
Msgbox tempVar(0)
End If
End Sub
The NotesDocument is used not only as a context for evaluating values that might be within the document but also for the Roles in the ACL of the database that contains the document.
Cesar Mugnatto

Tip: Evaluating @UserRoles (Cesar Mugnatto 16.Apr.04)
. . 
