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 +4 -4
- data/app/models/concerns/hydra/access_controls/embargoable.rb +10 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea7c4aaad5d8b8a2a09302a4e4c72bef6ae4e4e7
|
4
|
+
data.tar.gz: 48ec6139506893bd921326584e649e715806c41e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: :
|
9
|
-
validates :embargo_release_date, :'hydra/future_date' => true, if: :
|
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.
|
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-
|
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.
|
221
|
+
rubygems_version: 2.4.6
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Access controls for project hydra
|