Reporting script needs access defined

i have a script that needs to comb views to create a csv to email to certain users. The problem is that a given user may not have access to a document. I know that this is not an uncommon issue… I remember trying to address this in R5 but could not. Is there anything in 6 that I’m missing? I looked at the new notesagent classes but couldn’t find anything. any help would be greatly appreciated!

Subject: Why not create a scheduled agent?

That way, the agent can run with the permissions of the agent signer. Even better, you could have the agent run “on behalf of” someone with the correct database access credentials.

Presumably, you are not exposing data in the CSV that you want hidden from the user in the database anyways.

Subject: RE: Why not create a scheduled agent?

thank you for your response. I should have been a little morme detailed in my original post. I’d need to set the access in the script, not at the time of agent signing. Ideally, my application would allow people to sign up for a report on the web and a scheduled agent would go through a request view and then email the csv that represented a given view. I’d want each requestor to get a report containing only the docs that they can see using notes security

Subject: Re: More details…

Aaah, now I understand.

That’s a little more difficult.

How are your “readers”-type fields calculated?

Are you using roles/groups/explicitly-named users?

With the latter two, it should be easy to implement some code to ascertain whether or not a user has access to a particular document. With the former (roles), I’m not sure how you could accomplish that (sorry).

Subject: RE: Re: More details…

The new NotesDatabase.QueryAccessRoles method should work for the roles problem, since you can throw a NotesName at it rather than relying on the “current user”.

Subject: Excellent suggestion! Forgot about that one :frowning: