boston-library / commonwealth-vlr-engine

Commonwealth-VLR-Engine is a Rails engine for creating Blacklight apps that provide access to content from Solr/Fedora, packaging a number of feature-rich enhancements and modifications.
Apache License 2.0
8 stars 2 forks source link

validate object type in #show view #79

Open ebenenglish opened 1 year ago

ebenenglish commented 1 year ago

Currently it is possible to use any ARK id as an identifier in the show view for any object type (Institution, Collection, DigitalObject, FileSet). The app will attempt to render the view, which can result in ugly layouts.

For example, in Staging, bpl-dev:4q77fr32b is an Institution, but these URLs work fine:

/collections/bpl-dev:4q77fr32b
/search/bpl-dev:4q77fr32b

We should validate object types in the #show action for each controller, and return 404 if the object is not the expected type.