dor-rights-auth 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dor/rights_auth.rb +6 -6
  3. metadata +22 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 411e5433cabba2ab3f47558c514c1c2c8093c0c9803a8a81987ae47736f13523
4
- data.tar.gz: 7658e3e17dd9933ca60e76f1a26933722e4b5aa5e296623124923e006a087aad
3
+ metadata.gz: f73159863d58e9e7ff4a9117a959114a2eafb8473267609b893855336450c128
4
+ data.tar.gz: 4469a748cc9f5137f940570d9da78a5404e285f676e05e70b8618f08c99ca580
5
5
  SHA512:
6
- metadata.gz: 422dc8fe2ffe4974595f552dd289cd362779d0234e73d91200f468e96e4ad13883e685d00c17f892292261bb3527cf256ec462e6ccec5ee3b5e0302b77a44f9f
7
- data.tar.gz: cac9eaf44ae089b5b61350c72a5e873e37c1b13bc9d7735af0d78ced1e7071307dea827fbe3e8e7b94fafd72c6f9bc26aff950d3b763249f2946a75b5a1679c7
6
+ metadata.gz: 6906433f1b1ad52ab4d8fe164435f8eceaeab182b3d1d0268bd7870fb4d7bf4796c1dc5eb260c77eda04c6243934a77e2fe10148c818e79e14682978bec1677e
7
+ data.tar.gz: 3dcd28a093e1d1573d5152192e6335e5cc030a10e282b740dc2b7f49329115aa98122aa90d6d4304c785c6af78e555d7b4b7abae6d2f8759ec7b5f451c7d5172
@@ -37,13 +37,14 @@ module Dor
37
37
  CONTAINS_STANFORD_XPATH = "contains(translate(text(), 'STANFORD', 'stanford'), 'stanford')"
38
38
  NO_DOWNLOAD_RULE = 'no-download'
39
39
 
40
- attr_accessor :obj_lvl, :file, :embargoed, :index_elements
40
+ attr_accessor :obj_lvl, :file, :embargoed, :embargo_release_date, :index_elements
41
41
 
42
42
  # NOTE: index_elements is only valid for the xml as parsed, not after subsequent manipulation
43
43
 
44
44
  def initialize
45
45
  @file = {}
46
46
  @index_elements = {}
47
+ @embargoed = false
47
48
  end
48
49
 
49
50
  # Returns true if the object is under embargo.
@@ -423,12 +424,12 @@ module Dor
423
424
  # rights that make more sense at the object level (e.g. 'dark').
424
425
  def self.primary_access_rights(index_terms, errors)
425
426
  has_rule = index_terms.include? 'has_rule'
426
- if index_terms.include?('none_discover')
427
+ if index_terms.include?('none_discover') ||
428
+ errors.include?('no_discover_access') ||
429
+ errors.include?('no_discover_machine')
427
430
  'dark'
428
431
  elsif index_terms.include?('cdl_none')
429
432
  'controlled digital lending'
430
- elsif errors.include?('no_discover_access') || errors.include?('no_discover_machine')
431
- 'dark'
432
433
  elsif errors.include?('no_read_machine') || index_terms.include?('none_read')
433
434
  'citation'
434
435
  elsif index_terms.include? 'world_read'
@@ -508,12 +509,11 @@ module Dor
508
509
  end
509
510
  end
510
511
 
511
- # Initialze embargo_status to false
512
- rights.embargoed = false
513
512
  embargo_node = doc.at_xpath("//rightsMetadata/access[@type='read']/machine/embargoReleaseDate")
514
513
  if embargo_node
515
514
  embargo_dt = Time.parse(embargo_node.content)
516
515
  rights.embargoed = true if embargo_dt > Time.now
516
+ rights.embargo_release_date = embargo_dt
517
517
  end
518
518
 
519
519
  access_with_files = doc.xpath("//rightsMetadata/access[@type='read' and file]")
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-rights-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Mene
8
8
  - Joe Atzberger
9
9
  - Johnathan Martin
10
10
  - Naomi Dushay
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-01-07 00:00:00.000000000 Z
14
+ date: 2023-11-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri
@@ -42,7 +42,7 @@ dependencies:
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  - !ruby/object:Gem::Dependency
45
- name: coveralls
45
+ name: rake
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - ">="
@@ -56,35 +56,35 @@ dependencies:
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  - !ruby/object:Gem::Dependency
59
- name: rake
59
+ name: rspec
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
- version: '0'
64
+ version: '3.0'
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ">="
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '0'
71
+ version: '3.0'
72
72
  - !ruby/object:Gem::Dependency
73
- name: rspec
73
+ name: rubocop
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - "~>"
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: '3.0'
78
+ version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - "~>"
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: '3.0'
85
+ version: '0'
86
86
  - !ruby/object:Gem::Dependency
87
- name: rubocop
87
+ name: rubocop-rspec
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - ">="
@@ -98,7 +98,7 @@ dependencies:
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  - !ruby/object:Gem::Dependency
101
- name: rubocop-rspec
101
+ name: simplecov
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - ">="
@@ -141,10 +141,11 @@ files:
141
141
  - lib/dor/xsd/rights.xsd
142
142
  - lib/dor/xsd/rights_basics.xsd
143
143
  - lib/dor/xsd/rights_types.xsd
144
- homepage:
144
+ homepage:
145
145
  licenses: []
146
- metadata: {}
147
- post_install_message:
146
+ metadata:
147
+ rubygems_mfa_required: 'true'
148
+ post_install_message:
148
149
  rdoc_options: []
149
150
  require_paths:
150
151
  - lib
@@ -159,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
160
  - !ruby/object:Gem::Version
160
161
  version: 1.3.6
161
162
  requirements: []
162
- rubygems_version: 3.1.2
163
- signing_key:
163
+ rubygems_version: 3.4.20
164
+ signing_key:
164
165
  specification_version: 4
165
166
  summary: Parses rightsMetadata xml into a useable object
166
167
  test_files: []