Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You can solve this issue by serving the uploaded files through a controller for your application. Using a before_filter similar to the one you used previously in the TicketsController, this controller will check that the user attempting to access a file has permission to access that particular project.
When you implemented permission behavior before, you ensured that any unauthorized user would be blocked from accessing the resource you were trying to protect by writing a controller spec. You write this same kind of spec test for serving files.