OpenNTF.org - Find Users Role for processing
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Find Users Role for processing 
Rating:
Not Rated Yet 
Contributor:
John M Turnbow 
Category:
Lotusscript 
Type:
Example Code 
Document Release:
Notes Version:
R6.x, R8.x, R7.x 
Last Modified:
20 Feb 2009 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Set uidb = workspace.CurrentDatabase
Dim db As NotesDatabase

Set db = session.CurrentDatabase
'get list of roles assigned to a user
roles = db.QueryAccessRoles(session.UserName)

'Now, use Arraygetindex to set isuerInRole to true or false for later usage in the application
isUserInRole = Not Isnull(Arraygetindex(roles, "[SuperAdmin]"))

If isUserInRole Then
Messagebox "Super Admin",, "Yes - I am superman"
End If

Usage / Example
 Comments
Posted by Attila Peter on 02/27/2009 09:57:52 AMUI objects
Hi,
First, thank you for this code. My only question is, why do you need UI objects (workspace and UIDatabase)? If you use the UI objects, than you dont need the session object.
Regards,
PetiAti
 Add your comment!