Friday, January 14, 2011

How To Prohibit View Access

Suppose you have a bizarre requirement where you want to hide all views from users and yet allow them access documents. Such as in a situation where you need to open up a document in the UI based on what keywords a user enters in an entry form, yet you do not want people to see any view in the database. Since you do not know which document to restrict to whom, Readers field will not serve the purpose here. So, what do you do? Ha! I see your eyes light up and scream, “Duh! Just create hidden views.” Intelligent! And, my dear reader, what do you do about the people smart enough to do a ‘Shift + Go To’ in the View menu, that will present them with a list of all hidden views to select from? Yay, Gotcha!

Don’t let this trouble you for too long – the solution is amazingly simple. We’ll just employ a reserved keyword in Notes to befuddle the smart user. Create a frameset with two frames. Name the right frame ‘NotesView’ (yes! That’s the trick!) and make the frame width 0 percent and set ‘Allow Resizing’ to No.

In database properties, set Launch Option as ‘Open designated Frameset’ and set that to the Frameset you just created. And we are done! Whichever way you try to open any view now, including ‘View > Go To’, it will open in the ‘NotesView’ frame, and since you have set the frame size to zero, you just won’t be able to see the view.  Nor will the smart user. How cool is that!

1 comment:

  1. Another way is simply to add a prompt to QueryOpen event and set continue=false if you don't want to let them in. If they are allowed (ie: by Role) then set continue=true and the view will open.

    ReplyDelete