Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

Viewing documents where the current user equals the user name in a specified field

Ok, I think I am going mad over this one. I am trying to create a view where the current DB user sees all the documents where their username is listed in a specified field within those documents. This is my view selection:

SELECT (@name([CN];@username))=(@name([CN];selecttitle_10))

Selecttitle_10 is a name field.

Now, it seems to work, but, when I switch user IDs and select that view again, it displays the previous user IDs documents ather than the current user ID's documents. I have to go into design, refresh the view using the curly thing at the top left, close and save it and then the view is updated with the new user IDs documents. This is a bit frustrating, it's as if the view is not refreshing when the DB is accessed by a new user.

Anyone got any idea's of what I am doing wrong or am I just expecting too much?

1 Solution
Create a new view, type private-shared on first use, copying the design from the current view.

Your problem is that when you opened the view for the first user, the server built a new view index based on teh current user.  That index is shared by all users who enter the view.  Think about it -- for the "other views" in the database, it would be wasteful to have to build the view separately for each user, right?

That's just what private on first use is for -- each user gets their own index just for the vews where it is needed.

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now