Skip to main content

 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Tip: Evaluating @UserRoles
Cesar Mugnatto 16.Apr.04 04:54 PM a Web browser
Domino Designer -- LotusScript All Releases All Platforms

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)
. . RE: Tip: Evaluating @UserRoles (File Save 16.Apr.04)
. . RE: Tip: Evaluating @UserRoles (LoNo Developer 17.Apr.04)
. . . . RE: Tip: Evaluating @UserRoles (Cesar Mugnatto 17.Apr.04)
. . RE: Tip: Evaluating @UserRoles (Doug Finner 19.Apr.04)
. . . . RE: Tip: Evaluating @UserRoles (Cesar Mugnatto 19.Apr.04)
. . . . . . RE: Tip: Evaluating @UserRoles (Doug Finner 21.Apr.04)
. . . . . . . . RE: Tip: Evaluating @UserRoles (Cesar Mugnatto 22.Apr.04)



Lotus Software


  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Sandbox
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM accelerators
IBM Composite Applications
IBM Mashup Center
Lotus ActiveInsight
Lotus Connections
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Forms
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
LotusLive
LotusLive iNotes
LotusLive Meetings & Events
Lotus Mobile Connect
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Quickr
Lotus Sametime
Lotus Symphony
Lotus Web Content Management
Lotus Widget Factory
Lotus Workforce Management
WebSphere Dashboard Framework
WebSphere Portal
WebSphere Portal Express
WebSphere Portlet Factory

 Lotus Forums
Notes/Domino 8.5
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
Lotus ActiveInsight & WebSphere Dashboard Framework
Lotus Connections
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Forms
Lotus Labs
LotusLive Meetings
Lotus Mobile Connect
Lotus Quickr
Lotus Sametime
Lotus Sametime Unyte Events
Lotus Sametime Unyte Share
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Web Content Management
Lotus Widget Factory
Lotus Workflow
Lotus Workforce Management