diff --git a/hydra-access-controls/app/models/hydra/access_controls/permission.rb b/hydra-access-controls/app/models/hydra/access_controls/permission.rb index cf957d803..0f5897726 100644 --- a/hydra-access-controls/app/models/hydra/access_controls/permission.rb +++ b/hydra-access-controls/app/models/hydra/access_controls/permission.rb @@ -41,7 +41,7 @@ def assign_attributes(attributes) end def agent_name - URI.decode(parsed_agent.last) + URI.decode_www_form_component(parsed_agent.last) end def update(*) @@ -79,8 +79,11 @@ def build_agent(name, type) end end + # The current URL.hash standard (As of March 2021) is that the post-hash portion of the URL is not percent-decoded + # however in order to ensure backward compatibility with already recorded values we are normalizing + # the fragment here. See https://developer.mozilla.org/en-US/docs/Web/API/URL/hash def build_agent_resource(prefix, name) - [Agent.new(::RDF::URI.new("#{prefix}##{URI.encode(name)}"))] + [Agent.new(::RDF::URI.new("#{prefix}##{URI.encode(name)}").normalize!)] end def build_access(access) diff --git a/hydra-head.gemspec b/hydra-head.gemspec index 9f4a8122f..9a924291e 100644 --- a/hydra-head.gemspec +++ b/hydra-head.gemspec @@ -18,14 +18,14 @@ Gem::Specification.new do |s| s.add_dependency 'hydra-access-controls', version s.add_dependency 'hydra-core', version - s.add_dependency 'rails', '>= 5.2', '< 6.1' + s.add_dependency 'rails', '>= 5.2.4', '< 6.1' s.add_development_dependency 'coveralls' s.add_development_dependency 'engine_cart', '~> 2.2' s.add_development_dependency 'factory_bot' - s.add_development_dependency 'fcrepo_wrapper', '~> 0.6' + s.add_development_dependency 'fcrepo_wrapper', '~> 0.9' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'simplecov' - s.add_development_dependency 'solr_wrapper', '~> 0.18' + s.add_development_dependency 'solr_wrapper', '~> 3' s.add_development_dependency 'rspec_junit_formatter' end