workbench: Reader tokens show collection files.
authorBrett Smith <brett@curoverse.com>
Mon, 5 May 2014 16:55:29 +0000 (12:55 -0400)
committerBrett Smith <brett@curoverse.com>
Mon, 5 May 2014 19:19:40 +0000 (15:19 -0400)
commit3398985fa7f0997c225b55efaa97dc000a8234fa
tree65c023343ea149c962e6c8a45d915b2e2099cdc8
parent5ab27a2c4889609669f6b04bd9dfd2e403e43441
workbench: Reader tokens show collection files.

Fundamentally, this commit aims to support reader tokens when showing
a file from a Collection.  Because this requires changing the token
handling generally, I also took this opportunity to improve error
reporting by checking the request's validity against the API server
before we pipe out to arv-get to render the file.

As a consequence, Workbench now returns a 404 if you request a file
using a token that does not have permission to read the collection.
Maybe this is not the best result, but previously it returned a 422,
so I think this counts as an improvement.
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/test/functional/collections_controller_test.rb