Class: Valkyrie::Indexers::AccessControlsIndexer
- Inherits:
-
Object
- Object
- Valkyrie::Indexers::AccessControlsIndexer
- Defined in:
- lib/valkyrie/indexers/access_controls_indexer.rb
Overview
Note:
This is used primarily with Solr
Provides an optional interface consistent with Hydra::AccessControls
This allows for storing access control information into an index
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource:, config: default_config) ⇒ AccessControlsIndexer
constructor
A new instance of AccessControlsIndexer.
- #to_solr ⇒ Object
Constructor Details
#initialize(resource:, config: default_config) ⇒ AccessControlsIndexer
Returns a new instance of AccessControlsIndexer.
26 27 28 29 |
# File 'lib/valkyrie/indexers/access_controls_indexer.rb', line 26 def initialize(resource:, config: default_config) @resource = resource @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
25 26 27 |
# File 'lib/valkyrie/indexers/access_controls_indexer.rb', line 25 def config @config end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
25 26 27 |
# File 'lib/valkyrie/indexers/access_controls_indexer.rb', line 25 def resource @resource end |
Instance Method Details
#to_solr ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/valkyrie/indexers/access_controls_indexer.rb', line 31 def to_solr return {} unless resource.respond_to?(:read_users) { config.fetch(:read_groups) => resource.read_groups, config.fetch(:read_users) => resource.read_users, config.fetch(:edit_users) => resource.edit_users, config.fetch(:edit_groups) => resource.edit_groups } end |