A Rails engine providing Hydra and ActiveRecord models and common services for the Duke Digital Repository.
Add to your application's Gemfile:
ddr-models has several runtime dependencies that are independently configurable:
ddr-models configuration options:
- Authentication/Authorization options are set on Ddr::Auth.
Additional configuration steps
app/models/user.rb and remove content inserted by Hydra and Devise generators:
class User include Ddr::Auth::User # # REMOVE: # include Hydra::User # devise :database_authenticatable [...] # # DO NOT REMOVE: # Blacklight::User end
The hydra-head generator may have created a class module at
app/models/ability.rb like so:
class Ability include Hydra::Ability end
Change the class like so:
class Ability < Ddr::Auth::Ability # # REMOVE: # include Hydra::Ability # # Add "ability definitions" -- i.e., subclasses of Ddr::Auth::AbilityDefinitions. # # self.ability_definitions += [ ... ] # end
enforce_show_permissions, so most likely it should be included in
class ApplicationController < ActionController::Base include Ddr::Auth::RoleBasedAccessControlsEnforcement end
class SolrDocument include Blacklight::Solr::Document include Ddr::Models::SolrDocument ... end
Auxiliary Web Services
In order to use the auxiliary web services, set the
DDR_AUX_API_URL environment variable. You may wish to install the ddr-aux app locally and run it.
Install the ddr-models migrations:
rake db:migrate db:test:prepare