views:

785

answers:

3

I'm working on a Lotus Domino Web application and I have a view that should only show the current user's documents. I know this is not the best for the server because it has to keep calculating this, but it is a requirement...

This is the view selection formula that I'm using:

SELECT (Form="Atom Request" | Form="AtomRequest") & @Name([CN];RequestAuthor) = @Name([CN];@UserName)

The RequestAuthor field is a computed when composed field that captures the author name.

The view selection works fine for me, but other users are able to see other users documents in this view.

I'm probably overlooking something obvious....

Any suggestions?

Derek

A: 

I converted the view to be a categorized view - categorized by the AuthorName.

Then I embedded the view on the view template form setting it to display a single category.

The single category is the user name.

Seems to have done the trick..

Derek
+1  A: 

do you require the user to be able to see documents other than their own (outside of this view I mean)?

If not, then use a readers field on the documents to limit who can see each document.

Then you won't need the @Name([CN];RequestAuthor) = @Name([CN];@UserName) part of the selection formula.

Otherwise if you do need users to be able to see documents other than their own the embedded categorized approach you've taken is probably the cleanest.

LRE
For must users that would work, but there is a class of super-users who are able to see/edit more then just their own documents. So the my documents view would not work for them, but would for everyone else. The categorized view seems to have done the trick - I don't have the @Name([CN];RequestAuthor) = @Name([CN];@UserName) in the view anymore - it is now in the single category formula on the embedded view.....
Derek
+1  A: 

LRE's solution is a good one. But from a design POV, do not use @UserName or @Now or @today in view selection formula's it causes serious performance problems for your database and the server.

Everytime you open the view the server will be rebuilding the index. If you do need to use user specific info, create a scheduled agent that will set the value in a field and then reference the field as part of the view formula. Just don't use any dynamic "@" functions in the view formula that would change the criteria.

giuliocc