hydra-access-controls 9.2.1 → 9.2.2

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: 4e86f8618f5fea8b5b0ebb586211a5a24e69af62
4
- data.tar.gz: ade8ed9c17682b50360720acc0e676dbb06a2da4
3
+ metadata.gz: ea7c4aaad5d8b8a2a09302a4e4c72bef6ae4e4e7
4
+ data.tar.gz: 48ec6139506893bd921326584e649e715806c41e
5
5
  SHA512:
6
- metadata.gz: 38c71a8bea0eba274948914728e8b482e2be8ea17017d1e7a185ccc9507c2cd4a38ed2b2800aba272a4b04219b913bac0093c32ca369e539270195b987011e91
7
- data.tar.gz: 22f264780da8a0add489f00ea65ef86fa20ee5201d0b0c9dc0a8e9aba0213fbed13b716b51b574e3fcca664ed7b02bf07c90f0874a97f4a6afd736958284a909
6
+ metadata.gz: bbd45858a87ce422b304789f35330de95c6642c68e57ee8a07e2a881af4a7b92495e25a1427ddf6799c6cdb99a889a0666b97d4a2878a9427933755ebeedad1d
7
+ data.tar.gz: 12ebdbb5cc2916346399453d12efad8cb9f4b78f720924061099624e31eefa66f4ffb112a0d1649fed1784fe45abd2ad187cd0167b068cf29e2cbc95dd737ea3
@@ -5,8 +5,8 @@ module Hydra
5
5
  include Hydra::AccessControls::WithAccessRight
6
6
 
7
7
  included do
8
- validates :lease_expiration_date, :'hydra/future_date' => true, if: :lease
9
- validates :embargo_release_date, :'hydra/future_date' => true, if: :embargo
8
+ validates :lease_expiration_date, :'hydra/future_date' => true, if: :enforce_future_date_for_lease?
9
+ validates :embargo_release_date, :'hydra/future_date' => true, if: :enforce_future_date_for_embargo?
10
10
 
11
11
  belongs_to :embargo, predicate: Hydra::ACL.hasEmbargo, class_name: 'Hydra::AccessControls::Embargo'
12
12
  belongs_to :lease, predicate: Hydra::ACL.hasLease, class_name: 'Hydra::AccessControls::Lease'
@@ -15,6 +15,14 @@ module Hydra
15
15
  delegate :visibility_during_lease, :visibility_during_lease=, :visibility_after_lease, :visibility_after_lease=, :lease_expiration_date, :lease_expiration_date=, :lease_history, :lease_history=, to: :existing_or_new_lease
16
16
  end
17
17
 
18
+ def enforce_future_date_for_lease?
19
+ lease
20
+ end
21
+
22
+ def enforce_future_date_for_embargo?
23
+ embargo
24
+ end
25
+
18
26
  # if the embargo exists return it, if not, build one and return it
19
27
  def existing_or_new_embargo
20
28
  embargo || build_embargo
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.2.1
4
+ version: 9.2.2
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: 2015-07-28 00:00:00.000000000 Z
13
+ date: 2015-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  requirements: []
220
220
  rubyforge_project:
221
- rubygems_version: 2.4.5
221
+ rubygems_version: 2.4.6
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Access controls for project hydra