hydra-access-controls 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3de84ad4f28bb521a7d0bfee19b2ef924237f9a4
4
- data.tar.gz: 80c68848f0bd1f5ba707cba461edf4a83ebf7535
3
+ metadata.gz: ca22da31960aa9a61b220138b98ab546ae89248a
4
+ data.tar.gz: eb0eaaea858ba9a5e4deff9bc5e560e7e6b7c510
5
5
  SHA512:
6
- metadata.gz: 3f15576c15c046cf0ceaf8e82327068c6c580c4a7f552fc3107e7f152f6d941714fd1c419fdf98a6825c44154421ab72d77b9febd0317c9ce42cc4030ebcf9ef
7
- data.tar.gz: 19f2513eee85f853c4dc1b43e0d8ac7fd9b583930955ee978e38cbb1b0fff400f7a5dfabd0a06f9daf0a5c60e4520dffcbec683e5942582153c76ef7db7d12df
6
+ metadata.gz: 976c336b1590e3a2236bac8af7bf5e0f9593565c6520dcb9d9df2c60ecb428210e232a0b2d9b2298ec1ed4e3343e4ab18e32e45a64c04ccdf774064a1e22ec34
7
+ data.tar.gz: 753774cbaeb18db6760686e53afcc2efcaa36535206f956aca11e32708b1b151676e741d86b869f4a9e7f1e3f806252a4fa8a7d330ee80b5c67abc3a3407bcf0
@@ -53,19 +53,21 @@ In config/initializers/hydra_config.rb
53
53
  <pre>
54
54
  Hydra.configure(:shared) do |config|
55
55
  # ... other stuff ...
56
+ indexer = Solrizer::Descriptor.new(:string, :stored, :indexed, :multivalued)
56
57
  config[:permissions] = {
57
- :discover => {:group =>"discover_access_group_t", :individual=>"discover_access_person_t"},
58
- :read => {:group =>"read_access_group_t", :individual=>"read_access_person_t"},
59
- :edit => {:group =>"edit_access_group_t", :individual=>"edit_access_person_t"},
60
- :owner => "depositor_t",
61
- :embargo_release_date => "embargo_release_date_dt"
58
+ :discover => {:group =>ActiveFedora::SolrService.solr_name("discover_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("discover_access_person", indexer)},
59
+ :read => {:group =>ActiveFedora::SolrService.solr_name("read_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("read_access_person", indexer)},
60
+ :edit => {:group =>ActiveFedora::SolrService.solr_name("edit_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("edit_access_person", indexer)},
61
+ :owner => ActiveFedora::SolrService.solr_name("depositor", indexer),
62
+ :embargo_release_date => ActiveFedora::SolrService.solr_name("embargo_release_date", Solrizer::Descriptor.new(:date, :stored, :indexed))
62
63
  }
64
+ indexer = Solrizer::Descriptor.new(:string, :stored, :indexed, :multivalued)
63
65
  config[:permissions][:inheritable] = {
64
- :discover => {:group =>"inheritable_discover_access_group_t", :individual=>"inheritable_discover_access_person_t"},
65
- :read => {:group =>"inheritable_read_access_group_t", :individual=>"inheritable_read_access_person_t"},
66
- :edit => {:group =>"inheritable_edit_access_group_t", :individual=>"inheritable_edit_access_person_t"},
67
- :owner => "inheritable_depositor_t",
68
- :embargo_release_date => "inheritable_embargo_release_date_dt"
66
+ :discover => {:group =>ActiveFedora::SolrService.solr_name("inheritable_discover_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("inheritable_discover_access_person", indexer)},
67
+ :read => {:group =>ActiveFedora::SolrService.solr_name("inheritable_read_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("inheritable_read_access_person", indexer)},
68
+ :edit => {:group =>ActiveFedora::SolrService.solr_name("inheritable_edit_access_group", indexer), :individual=>ActiveFedora::SolrService.solr_name("inheritable_edit_access_person", indexer)},
69
+ :owner => ActiveFedora::SolrService.solr_name("inheritable_depositor", indexer),
70
+ :embargo_release_date => ActiveFedora::SolrService.solr_name("inheritable_embargo_release_date", Solrizer::Descriptor.new(:date, :stored, :indexed))
69
71
  }
70
72
  end
71
73
  </pre>
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.required_ruby_version = '>= 1.9.3'
19
19
 
20
20
  gem.add_dependency 'activesupport'
21
- gem.add_dependency "active-fedora", '>= 6.0.0'
21
+ gem.add_dependency "active-fedora", '~> 6.1'
22
22
  gem.add_dependency 'cancan'
23
23
  gem.add_dependency 'deprecation'
24
24
  gem.add_dependency 'blacklight'
@@ -1,5 +1,6 @@
1
1
  require 'active_support'
2
2
  require 'active-fedora'
3
+ require 'blacklight'
3
4
  require 'cancan'
4
5
  require 'rails'
5
6
 
@@ -16,7 +16,7 @@ module Hydra::PolicyAwareAccessControlsEnforcement
16
16
  def policy_clauses
17
17
  policy_pids = policies_with_access
18
18
  return nil if policy_pids.empty?
19
- '(' + policy_pids.map {|pid| ActiveFedora::SolrService.solr_name("is_governed_by", :symbol) + ":info\\:fedora/#{pid.gsub(/:/, '\\\\:')}"}.join(' OR ') + ')'
19
+ '(' + policy_pids.map {|pid| ActiveFedora::SolrService.construct_query_for_rel(is_governed_by: "info:fedora/#{pid}")}.join(' OR ') + ')'
20
20
  end
21
21
 
22
22
 
@@ -96,12 +96,12 @@ describe Hydra::PolicyAwareAccessControlsEnforcement do
96
96
  policy_pids = (1..6).map {|n| "test:policy#{n}"}
97
97
  subject.should_receive(:policies_with_access).and_return(policy_pids)
98
98
  subject.apply_gated_discovery(@solr_parameters, @user_parameters)
99
- @solr_parameters[:fq].first.should include(" OR (#{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy1 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy2 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy3 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy4 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy5 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy6)")
99
+ @solr_parameters[:fq].first.should include(" OR (#{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy1 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy2 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy3 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy4 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy5 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy6)")
100
100
  end
101
101
  it "should not change anything if there are no clauses to add" do
102
102
  subject.stub(:policy_clauses).and_return(nil)
103
103
  subject.apply_gated_discovery(@solr_parameters, @user_parameters)
104
- @solr_parameters[:fq].first.should_not include(" OR (#{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy1 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy2 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy3 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy4 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy5 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora/test\\:policy6)")
104
+ @solr_parameters[:fq].first.should_not include(" OR (#{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy1 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy2 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy3 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy4 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy5 OR #{ActiveFedora::SolrService.solr_name('is_governed_by', :symbol)}:info\\:fedora\\/test\\:policy6)")
105
105
  end
106
106
  end
107
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-access-controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-28 00:00:00.000000000 Z
13
+ date: 2013-04-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -30,16 +30,16 @@ dependencies:
30
30
  name: active-fedora
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: 6.0.0
35
+ version: '6.1'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - '>='
40
+ - - ~>
41
41
  - !ruby/object:Gem::Version
42
- version: 6.0.0
42
+ version: '6.1'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: cancan
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.0.0
181
+ rubygems_version: 2.0.3
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Access controls for project hydra