UserRoles

I wrote a script that evaluates if a user is assigned a role or not. However, in the ACL I have a group listed not individuals and I am getting an error “Object variable not set”. I am guessing because they are in a group and not individual is the problem.

Here is my script:

Dim ss As New NotesSession

Dim ws As New Notesuiworkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim acl As NotesACL

Dim entry As NotesACLEntry

Dim Roles As Variant

Dim username As String

Set db = ss.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

username = ss.UserName

Set acl = db.ACL

Set entry = acl.GetEntry(username)

Forall r In entry.Roles 'Error stops at this line in the debugger

If r = “[VP]” And doc.Amt1(0) < 2500.01 Then

Messagebox “OK”,64, “Approval Checked”

Else

Messagebox “Your are not authorized for an amount greater than 2500.00”, 16, “Approval Amount”

End If

End Forall

Any suggestions?

Subject: UserRoles

Exactly – but you doesn’t has to be usin’ that there old-fashioned hand-cranked stuff any more. Look at NotesDatabase.QueryAccessRoles – it’s new to 6.5.

Subject: UserRoles LMAO

LMAO - WAYY TOOO FUNNY - Thanks for the laugh!

Subject: RE: UserRoles LMAO

Glad I could give a laugh or two sometimes. Sorry about the question but it is hard to keep up with what is new in the updates.

Thanks again for the help, I appreciate it.

Subject: RE: UserRoles LMAO

I’m rather hoping that the LMAO had more to do with the wording of my response than with your original question. I’ve been heavily involved in the beta programs for ND6 & 7; it’s my job to notice and test the new methods.

Subject: RE: UserRoles LMAO

Not a problem Stan, I really appreciate the help everyone gives in the forum without it we all could be pulling our hair out.

Again thank you Stan for your direction. It works great!