-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson: turn off access controls
This lesson is known to work with hydra-head version 6.0.0.
Please update this wiki to reflect any other versions that have been tested.
- (for now) Turn off access controls for Blacklight-based searches and "show" views
One of the main features that Hydra adds to Blacklight is the ability to control who has access to which information in search results. That topic gets a little bit complicated. For the purpose of this Tutorial we want to stay focused on showing you how to set up an app, define models and create objects based on those models, so in order to keep things simple we will make this Hydra Head behave like an open access repository where everyone can see everything. In another tutorial we will show how to assert access controls on objects and enforce those access controls in a Hydra Head.
If you open app/controllers/catalog_controller.rb
and look at the code near lines 8-12 you should see this:
# These before_filters apply the hydra access controls
before_filter :enforce_show_permissions, :only=>:show
# This applies appropriate access controls to all solr queries
CatalogController.solr_search_params_logic += [:add_access_controls_to_solr_params]
This code tells blacklight to enforce access controls on the search and result view pages. For the time being we will turn this off by commenting out two lines so that it looks like this:
# These before_filters apply the hydra access controls
#before_filter :enforce_show_permissions, :only=>:show
# This applies appropriate access controls to all solr queries
#CatalogController.solr_search_params_logic += [:add_access_controls_to_solr_params]
Then, save the file.
Go on to Lesson: Make Blacklight Return Search Results or return to the Dive into Hydra page.