class Hydra::Config::PermissionsConfig
Attributes
Public Class Methods
Source
# File lib/hydra/config.rb, line 62 def initialize @values = {} [:discover, :read, :edit].each do |key| @values[key] = GroupPermission.new( group: solr_name("#{prefix}#{key}_access_group", :symbol), individual: solr_name("#{prefix}#{key}_access_person", :symbol)) end @embargo = EmbargoConfig.new({}, prefix: prefix) @lease = LeaseConfig.new({}, prefix: prefix) end
Public Instance Methods
Source
# File lib/hydra/config.rb, line 92 def [] key case key when :discover, :read, :edit @values[key] when :inheritable inheritable when :policy_class @policy_class else raise "Unknown key #{key}" end end
Source
# File lib/hydra/config.rb, line 77 def []= key, value case key when :discover, :read, :edit self.assign_value key, value when :inheritable inheritable.merge! value when :policy_class self.policy_class = value when :owner Rails.logger.warn "':owner' is no longer a valid configuration for Hydra. Please remove it from your configuration." else raise "Unknown key `#{key.inspect}`" end end
Source
# File lib/hydra/config.rb, line 121 def discover= val assign_value :discover, val end
Source
# File lib/hydra/config.rb, line 105 def inheritable @inheritable ||= InheritablePermissionsConfig.new end
Source
# File lib/hydra/config.rb, line 73 def merge! values values.each {|k, v| self[k] = v } end
Protected Instance Methods
Source
# File lib/hydra/config.rb, line 138 def assign_value key, val @values[key].merge!(val) end
Source
# File lib/hydra/config.rb, line 142 def solr_name(*args) ActiveFedora.index_field_mapper.solr_name(*args) end