This can be done in Global.asax under Application_AuthenticateRequest or Application_BeginRequest. You can also register IHTTPHandeler and follow the same logic as Global.asax, which will listen for requests to the DocRepo folder and audit user permissions.
If you use ASP.NET MVC, you can easily create a “Download” action on your controller, which takes some kind of file identifier and performs your check. If you are using classic ASP.NET, you will create a page, download.aspx, which accepts some unique identifier (as suggested by Andrew).
In MVC, you can add an authorization filter to an action to allow only authenticated users, and from there you can check the level of each user. In MVC there is a file result:
return File(...);
source share