Currently the entire ListItem is removed from the Doc library if the user does not have permission to view the corresponding document, but I would really like it if the user could at least see the meta data with the list item, and prevent them from accessing the corresponding document (ie they click on the document link and get denied, or they type in the url by hand and get denied, etc).
Is there some Document Library event handler that handles ‘accessing’ a document which I can implement and check the user’s permissions before passing off the document to them? Or something along those lines..
The answer to my question: create a custom httpHandler that handles the document types that must be intercepted.
Good articles:
http://dotnetslackers.com/articles/aspnet/WatermarkingPDFDocumentsUsingHttpHandlers.aspx
http://blogs.msdn.com/b/kaevans/archive/2010/08/04/deploying-an-asp-net-httphandler-to-sharepoint-2010.aspx
Also, there may be a bug with the generic handler code that visual studio creates, read this article for creating an httpHandler with code behind,
http://aspnetresources.com/blog/httphandler_code_behind