hydra-access-controls 9.0.0.beta1 → 9.0.0.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08c21733735b5901ccfd378e26d531434c3693c0
|
4
|
+
data.tar.gz: 1193c86b764762ab44ec693466f0f60adfbe5f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b587e9d3574cc44c4b0fedb6f7395467780959f0de3adcdc3238da29f7c935eec3fc6c946af10717c2abe2262f741089d8eb64a972eb5240fa2aa83fe2152a3
|
7
|
+
data.tar.gz: 0e3ed0753358d92ecdb14d521a612e81b08ac6f49f1e1a5f676c90183c7a6d68b7bfe110c2177048967a993b85b6cbd28ae9d37c99fdf15b53f6856f67537454
|
@@ -1,27 +1,10 @@
|
|
1
1
|
module Hydra::AccessControls
|
2
2
|
class Embargo < ActiveFedora::Base
|
3
|
-
property :visibility_during_embargo, predicate: Hydra::ACL.visibilityDuringEmbargo
|
4
|
-
property :visibility_after_embargo, predicate: Hydra::ACL.visibilityAfterEmbargo
|
5
|
-
property :embargo_release_date, predicate: Hydra::ACL.embargoReleaseDate
|
3
|
+
property :visibility_during_embargo, predicate: Hydra::ACL.visibilityDuringEmbargo, multiple:false
|
4
|
+
property :visibility_after_embargo, predicate: Hydra::ACL.visibilityAfterEmbargo, multiple:false
|
5
|
+
property :embargo_release_date, predicate: Hydra::ACL.embargoReleaseDate, multiple:false
|
6
6
|
property :embargo_history, predicate: Hydra::ACL.embargoHistory
|
7
7
|
|
8
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
9
|
-
def visibility_during_embargo_with_first
|
10
|
-
visibility_during_embargo_without_first.first
|
11
|
-
end
|
12
|
-
alias_method_chain :visibility_during_embargo, :first
|
13
|
-
|
14
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
15
|
-
def visibility_after_embargo_with_first
|
16
|
-
visibility_after_embargo_without_first.first
|
17
|
-
end
|
18
|
-
alias_method_chain :visibility_after_embargo, :first
|
19
|
-
|
20
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
21
|
-
def embargo_release_date_with_first
|
22
|
-
embargo_release_date_without_first.first
|
23
|
-
end
|
24
|
-
alias_method_chain :embargo_release_date, :first
|
25
8
|
|
26
9
|
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
27
10
|
def embargo_release_date_with_casting=(date)
|
@@ -1,28 +1,10 @@
|
|
1
1
|
module Hydra::AccessControls
|
2
2
|
class Lease < ActiveFedora::Base
|
3
|
-
property :visibility_during_lease, predicate: Hydra::ACL.visibilityDuringLease
|
4
|
-
property :visibility_after_lease, predicate: Hydra::ACL.visibilityAfterLease
|
5
|
-
property :lease_expiration_date, predicate: Hydra::ACL.leaseExpirationDate
|
3
|
+
property :visibility_during_lease, predicate: Hydra::ACL.visibilityDuringLease, multiple:false
|
4
|
+
property :visibility_after_lease, predicate: Hydra::ACL.visibilityAfterLease, multiple:false
|
5
|
+
property :lease_expiration_date, predicate: Hydra::ACL.leaseExpirationDate, multiple:false
|
6
6
|
property :lease_history, predicate: Hydra::ACL.leaseHistory
|
7
7
|
|
8
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
9
|
-
def visibility_during_lease_with_first
|
10
|
-
visibility_during_lease_without_first.first
|
11
|
-
end
|
12
|
-
alias_method_chain :visibility_during_lease, :first
|
13
|
-
|
14
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
15
|
-
def visibility_after_lease_with_first
|
16
|
-
visibility_after_lease_without_first.first
|
17
|
-
end
|
18
|
-
alias_method_chain :visibility_after_lease, :first
|
19
|
-
|
20
|
-
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
21
|
-
def lease_expiration_date_with_first
|
22
|
-
lease_expiration_date_without_first.first
|
23
|
-
end
|
24
|
-
alias_method_chain :lease_expiration_date, :first
|
25
|
-
|
26
8
|
# Hack until ActiveFedora supports activeTriples 0.3.0 (then we can just use super)
|
27
9
|
def lease_expiration_date_with_casting=(date)
|
28
10
|
date = DateTime.parse(date) if date && date.kind_of?(String)
|
@@ -4,8 +4,8 @@ describe Hydra::AdminPolicy do
|
|
4
4
|
|
5
5
|
describe "when setting attributes" do
|
6
6
|
before do
|
7
|
-
subject.title = "My title"
|
8
|
-
subject.description = "My description"
|
7
|
+
subject.title = ["My title"]
|
8
|
+
subject.description = ["My description"]
|
9
9
|
end
|
10
10
|
its(:title) { is_expected.to eq "My title"}
|
11
11
|
its(:description) { is_expected.to eq "My description"}
|
@@ -13,7 +13,7 @@ describe Hydra::AdminPolicy do
|
|
13
13
|
|
14
14
|
|
15
15
|
describe "to_solr" do
|
16
|
-
subject { Hydra::AdminPolicy.new(:title=>"Foobar").to_solr }
|
16
|
+
subject { Hydra::AdminPolicy.new(:title=>["Foobar"]).to_solr }
|
17
17
|
it "should have title_ssim" do
|
18
18
|
expect(subject[ActiveFedora::SolrQueryBuilder.solr_name('title', type: :string)]).to eq ["Foobar"]
|
19
19
|
end
|
@@ -42,12 +42,12 @@ describe Hydra::AdminPolicy do
|
|
42
42
|
end
|
43
43
|
it "should update permissions on existing users" do
|
44
44
|
subject.default_permissions.build({:name=>'user1', :access=>'discover', :type=>'person'})
|
45
|
-
subject.default_permissions.first.mode = ::ACL.Write
|
45
|
+
subject.default_permissions.first.mode = Hydra::AccessControls::Mode.new(::ACL.Write)
|
46
46
|
expect(subject.default_permissions.map(&:to_hash)).to eq [{:type=>'person', :access=>'edit', :name=>'user1'}]
|
47
47
|
end
|
48
48
|
it "should update permissions on existing groups" do
|
49
49
|
subject.default_permissions.build({:name=>'group1', :access=>'discover', :type=>'group'})
|
50
|
-
subject.default_permissions.first.mode = ::ACL.Write
|
50
|
+
subject.default_permissions.first.mode = Hydra::AccessControls::Mode.new(::ACL.Write)
|
51
51
|
expect(subject.default_permissions.map(&:to_hash)).to eq [{:type=>'group', :access=>'edit', :name=>'group1'}]
|
52
52
|
end
|
53
53
|
it "should assign user permissions when :type == 'person'" do
|
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: 9.0.0.
|
4
|
+
version: 9.0.0.beta2
|
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: 2014-12-
|
13
|
+
date: 2014-12-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|