Product enhancement request for LotusScript / Java

A customer of mine has me writing code to extract data and put it into M$-Excel spreadsheets, then mailing it to recipients. I’m doing this with the org.apache.poi.hssf Java library in a scheduled Notes Agent. In order for us to support the goals of IT Security, we want to be able to ascertain whether the user receiving the information actually also has proper access to the database that the data is being extracted from.

This topic is already important since SOX compliance has forced the issue. It is becoming even more crucial with the event of IBM/Lotus supporting ODF with Notes. Please don’t underestimate the importance of security ramifications of creating and extracting data in ODF format and using it elsewhere!

Those of us who have been working with Notes for many years have almost taken Notes security for granted. This is becoming even more evident while I offer my humble services to create this fine reporting engine.

At this time, there is no way for a Notes Programmer to select a Name from the NAB in formula language, LotusScript or Java and, using parameters with a simple method or property to ascertain that person’s aclEntry or access level to databases, forms, views, fields, etc. It’s not difficult if the user is the one running the code. If we have a scheduled agent running code to extract data during the night then email it, there is no simple way that the agent can ascertain whether the recipient is actually authorized in the ACL to view that data.

I have written a few lines of code for clarity. Strange, my compiler didn’t like my method names!

Class ACLPeek

Private userRoles() As String



Private userAccessLevel As String



Private userACLEntry As NotesACLEntry



Public Function getUserRoles() As Variant

	getUserRoles = userRoles

End Function



Sub new( myUser As NotesName )

	Dim s As New NotesSession

	Dim db As NotesDatabase

	Dim acl As NotesACL

	

	Set db = s.GetDatabase( "MyServer", "MyDatabase" )

	Set acl = db.ACL

	

	'This should work, regardless of whether the user is explicitly names in the ACL

	Me.userACLEntry = acl.GetEntry( myUser.Canonical )

	

	Me.userRoles = myUser.UserRoles( db ) 

	Me.userAccessLevel = myUser.AccessLevel( Db)

	

	If db.userHasRole( myUser.Canonical , "myRole" ) Then

		' Export some data and send it to them in an email

	End If

	

	If db.minimumAccessLevel( myUser.Canonical ,  ACLLEVEL_READER ) Then

		' Export some data and send it to them in an email

	End If

	

End Sub

End Class

I’m hoping that IBM / Lotus sees that security need for this type of functionality inside of the programming languages used in the Notes / Domino product line.

Kind regards,

Marcus Laubli

Subject: Product enhancement request for LotusScript / Java

I understand this problem, and have had to work around it myself a couple of times, but are you sure this is the best approach to the problem?

I wouldn’t want an Excel document mailed around with confidential data, that the user might send on to people that shouldn’t see it. Besides, if the number of people receiving this e-mail are high, it would put unneccesary strain on the router.

Wouldn’t it be better to create the Excel file and attach it to a document in the database instead, and then send out a mail containing a document link to that document. That way, only people that are authorized to see the data can access the Excel file.

/Peter

Subject: RE: Product enhancement request for LotusScript / Java

I agree with everything you have said.

The Three options the client is requesting is

  • Attach to Search form

  • Write to File System

  • Email to recipient

Marcus

Subject: Product enhancement request for LotusScript / Java

As you just showed, you can use the NotesACL class to determine the user’s access to the database, so I’m not sure what the problem is. Are you saying you want ACL access to be more transparent, or do you have some issue with making this work?

Subject: RE: Product enhancement request for LotusScript / Java

If users are added to the ACL using groups, as it should be, you can’t just look in the ACL and see what access a specific user has. You would have to go through all groups in the ACL and see which groups the user belongs to, including nested groups. This is not an easy way to find out a users access.

/Peter

Subject: RE: Product enhancement request for LotusScript / Java

NotesDatabase.QueryAccess will return the specified users’s access level to a given database. It’s a LotusScript equivalent of @UserAccess, and as such it won’t tell you the roles they have or tell you which specific ACL refinements they have checked. It might be a starting point at least. If QueryAccess says the person has No Access then skip on by them.

The other thing to consider in your specific example is the impact of reader fields on individual documents, if they are being used.

Subject: RE: Product enhancement request for LotusScript / Java

Thank you Charles!

Database.QueryAccess,

Database.QueryAccessPrivileges, and Database.QueryAccessRoles do exactly what I need!

Marcus