dor-rights-auth 1.1.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/dor/rights/auth.rb +2 -0
- data/lib/dor/rights_auth.rb +207 -30
- metadata +38 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60b3d1ae87e3950792e247f96ea41245ef998ff8db8c17f081eb310faec851dd
|
4
|
+
data.tar.gz: 531ea2c07aff3cb9a9a87076123ac43be63f4e0a834c4c5677ad7f4c3756bba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc78bc626716818af2369ee0221de05418d1feaf65a87249594497b353b01010825c13bcc6a0ca4e6f26bfe1558bde6e49b8f8cc2fd6a28acd8dfaa8a1fb51cf
|
7
|
+
data.tar.gz: 5db61b24e0a5e24a46e264b610144d58af26bc0b5538799d8811e4aece667dcc30e23e6bd58efbc04958e4189048a514a7d5322d8f016811083685ba5c691029
|
data/lib/dor/rights/auth.rb
CHANGED
data/lib/dor/rights_auth.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'nokogiri'
|
2
4
|
require 'time'
|
3
5
|
|
@@ -8,7 +10,7 @@ module Dor
|
|
8
10
|
Rights = Struct.new(:value, :rule)
|
9
11
|
|
10
12
|
# Rights for an object or File
|
11
|
-
EntityRights = Struct.new(:world, :group, :agent, :location)
|
13
|
+
EntityRights = Struct.new(:world, :group, :agent, :location, :controlled_digital_lending)
|
12
14
|
# class EntityRights
|
13
15
|
# @world = #Rights
|
14
16
|
# @group {
|
@@ -18,6 +20,7 @@ module Dor
|
|
18
20
|
# 'app1' => #Rights,
|
19
21
|
# 'app2' => #Rights
|
20
22
|
# }
|
23
|
+
# @controlled_digital_lending = false
|
21
24
|
# end
|
22
25
|
|
23
26
|
# class Dor::RightsAuth
|
@@ -31,7 +34,8 @@ module Dor
|
|
31
34
|
# read rights_xml only once and create query-able methods for rights info
|
32
35
|
class RightsAuth
|
33
36
|
|
34
|
-
CONTAINS_STANFORD_XPATH = "contains(translate(text(), 'STANFORD', 'stanford'), 'stanford')"
|
37
|
+
CONTAINS_STANFORD_XPATH = "contains(translate(text(), 'STANFORD', 'stanford'), 'stanford')"
|
38
|
+
NO_DOWNLOAD_RULE = 'no-download'
|
35
39
|
|
36
40
|
attr_accessor :obj_lvl, :file, :embargoed, :index_elements
|
37
41
|
|
@@ -44,16 +48,40 @@ module Dor
|
|
44
48
|
|
45
49
|
# Returns true if the object is under embargo.
|
46
50
|
# @return [Boolean]
|
47
|
-
def embargoed?
|
51
|
+
def embargoed?
|
48
52
|
@embargoed
|
49
53
|
end
|
50
54
|
|
55
|
+
# summary level rights info is mostly used for object-level indexing/faceting.
|
56
|
+
# thus, we currently only calculate it when parsing object rights for indexing.
|
57
|
+
# to keep from having to refactor or duplicate code right now, we'll just leverage
|
58
|
+
# what we've got, checking whether index_elements is populated, and raising an error
|
59
|
+
# if the object wasn't instantiated in a way that makes those calculations.
|
60
|
+
def check_index_elements_calculated!
|
61
|
+
unless index_elements.size > 0
|
62
|
+
raise "primary access rights not calculated. instantiate by calling '.parse(xml, forindex = true)'."
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# this is just a convenience method for asking whether an object's rights would
|
67
|
+
# classify it as 'dark'.
|
68
|
+
def dark?
|
69
|
+
check_index_elements_calculated!
|
70
|
+
index_elements[:primary] == 'dark'
|
71
|
+
end
|
72
|
+
|
73
|
+
# this is just a convenience method for asking whether an object's rights would
|
74
|
+
# classify it as 'citation only'.
|
75
|
+
def citation_only?
|
76
|
+
check_index_elements_calculated!
|
77
|
+
index_elements[:primary] == 'citation'
|
78
|
+
end
|
79
|
+
|
51
80
|
# Returns true if the object is world readable AND has no rule attribute
|
52
81
|
# @return [Boolean]
|
53
82
|
def world_unrestricted?
|
54
83
|
@obj_lvl.world.value && @obj_lvl.world.rule.nil?
|
55
84
|
end
|
56
|
-
|
57
85
|
alias_method :public_unrestricted?, :world_unrestricted?
|
58
86
|
|
59
87
|
def readable?
|
@@ -61,20 +89,41 @@ module Dor
|
|
61
89
|
public_unrestricted? || stanford_only_unrestricted?
|
62
90
|
end
|
63
91
|
|
92
|
+
# Returns true if the object is readable AND allows download
|
93
|
+
# @return [Boolean]
|
94
|
+
def world_downloadable?
|
95
|
+
world_rule = @obj_lvl.world.rule
|
96
|
+
@obj_lvl.world.value && (world_rule.nil? || world_rule != NO_DOWNLOAD_RULE)
|
97
|
+
end
|
98
|
+
alias_method :public_downloadable?, :world_downloadable?
|
99
|
+
|
100
|
+
# Returns true if the object is enabled for controlled digital lending
|
101
|
+
# @return [Boolean]
|
102
|
+
def controlled_digital_lending?
|
103
|
+
@obj_lvl.controlled_digital_lending
|
104
|
+
end
|
105
|
+
|
64
106
|
# Returns true if the object is stanford-only readable AND has no rule attribute
|
65
107
|
# @return [Boolean]
|
66
108
|
def stanford_only_unrestricted?
|
67
109
|
@obj_lvl.group[:stanford].value && @obj_lvl.group[:stanford].rule.nil?
|
68
110
|
end
|
69
111
|
|
112
|
+
# Returns true if the object is stanford-only readable AND allows download
|
113
|
+
# @return [Boolean]
|
114
|
+
def stanford_only_downloadable?
|
115
|
+
stanford_rule = @obj_lvl.group[:stanford].rule
|
116
|
+
@obj_lvl.group[:stanford].value && (stanford_rule.nil? || stanford_rule != NO_DOWNLOAD_RULE)
|
117
|
+
end
|
118
|
+
|
70
119
|
# Returns true if the passed in agent (usually an application) is allowed access to the object without a rule
|
71
120
|
# @param [String] agent_name Name of the agent that wants to access this object
|
72
121
|
# @return [Boolean]
|
73
122
|
def agent_unrestricted?(agent_name)
|
74
123
|
return false unless @obj_lvl.agent.key? agent_name
|
124
|
+
|
75
125
|
@obj_lvl.agent[agent_name].value && @obj_lvl.agent[agent_name].rule.nil?
|
76
126
|
end
|
77
|
-
|
78
127
|
alias_method :allowed_read_agent?, :agent_unrestricted?
|
79
128
|
|
80
129
|
# Returns true if the file is stanford-only readable AND has no rule attribute
|
@@ -98,18 +147,44 @@ module Dor
|
|
98
147
|
|
99
148
|
@file[file_name].world.value && @file[file_name].world.rule.nil?
|
100
149
|
end
|
101
|
-
|
102
150
|
alias_method :public_unrestricted_file?, :world_unrestricted_file?
|
103
151
|
|
152
|
+
# Returns true if the file is world readable AND either has no rule attribute or
|
153
|
+
# the rule attribute is not 'no-download'
|
154
|
+
# If world rights do not exist for this file, then object level rights are returned
|
155
|
+
# @see #world_downloadable?
|
156
|
+
# @param [String] file_name name of the file being tested
|
157
|
+
# @return (see #world_rights)
|
158
|
+
def world_downloadable_file?(file_name)
|
159
|
+
return world_downloadable? if @file[file_name].nil? || @file[file_name].world.nil?
|
160
|
+
|
161
|
+
world_rule = @file[file_name].world.rule
|
162
|
+
@file[file_name].world.value && (world_rule.nil? || world_rule != NO_DOWNLOAD_RULE)
|
163
|
+
end
|
164
|
+
alias_method :public_downloadable_file?, :world_downloadable_file?
|
165
|
+
|
166
|
+
def stanford_only_downloadable_file?(file_name)
|
167
|
+
return stanford_only_downloadable? if @file[file_name].nil? || @file[file_name].group[:stanford].nil?
|
168
|
+
|
169
|
+
stanford_rule = @file[file_name].group[:stanford].rule
|
170
|
+
@file[file_name].group[:stanford].value && (stanford_rule.nil? || stanford_rule != NO_DOWNLOAD_RULE)
|
171
|
+
end
|
172
|
+
|
173
|
+
def cdl_rights_for_file(file_name)
|
174
|
+
return controlled_digital_lending? if @file[file_name].nil? || @file[file_name].controlled_digital_lending.nil?
|
175
|
+
|
176
|
+
@file[file_name].controlled_digital_lending.value
|
177
|
+
end
|
178
|
+
|
104
179
|
# Returns whether an object-level world node exists, and the value of its rule attribute
|
105
|
-
# @return [Array<(Boolean, String)>] First value:
|
180
|
+
# @return [Array<(Boolean, String)>] First value: existence of node. Second Value: rule attribute, nil otherwise
|
106
181
|
# @example Using multiple variable assignment to read both array elements
|
107
182
|
# world_exists, world_rule = rights.world_rights
|
108
183
|
def world_rights
|
109
184
|
[@obj_lvl.world.value, @obj_lvl.world.rule]
|
110
185
|
end
|
111
186
|
|
112
|
-
# Returns whether
|
187
|
+
# Returns whether an object-level group/stanford node exists, and the value of its rule attribute
|
113
188
|
# @return (see #world_rights)
|
114
189
|
# @example Using multiple variable assignment to read both array elements
|
115
190
|
# su_only_exists, su_only_rule = rights.stanford_only_rights
|
@@ -135,8 +210,8 @@ module Dor
|
|
135
210
|
# @return [Boolean] whether any location restrictions exist on the file or the
|
136
211
|
# object itself (in the absence of file-level rights)
|
137
212
|
def restricted_by_location?(file_name = nil)
|
138
|
-
any_file_location = @file[file_name]
|
139
|
-
any_object_location = @obj_lvl.location
|
213
|
+
any_file_location = @file[file_name]&.location&.any?
|
214
|
+
any_object_location = @obj_lvl.location&.any?
|
140
215
|
|
141
216
|
any_file_location || any_object_location
|
142
217
|
end
|
@@ -149,6 +224,7 @@ module Dor
|
|
149
224
|
# @note should be called after doing a check for world_unrestricted?
|
150
225
|
def agent_rights(agent_name)
|
151
226
|
return [false, nil] if @obj_lvl.agent[agent_name].nil?
|
227
|
+
|
152
228
|
[@obj_lvl.agent[agent_name].value, @obj_lvl.agent[agent_name].rule]
|
153
229
|
end
|
154
230
|
|
@@ -168,7 +244,7 @@ module Dor
|
|
168
244
|
# Returns whether a file-level group/stanford node exists, and the value of its rule attribute
|
169
245
|
# If a group/stanford node does not exist for this file, then object-level group/stanford rights are returned
|
170
246
|
# @see #stanford_only_rights
|
171
|
-
# @param
|
247
|
+
# @param [String] file_name name of the file being tested
|
172
248
|
# @return (see #world_rights)
|
173
249
|
# @example Using multiple variable assignment to read both array elements
|
174
250
|
# su_only_exists, su_only_rule = rights.stanford_only_rights_for_file('somefile')
|
@@ -215,6 +291,7 @@ module Dor
|
|
215
291
|
# @return [Array] list of things that are wrong with it
|
216
292
|
def self.validate_lite(doc)
|
217
293
|
return ['no_rightsMetadata'] if doc.nil? || doc.at_xpath('//rightsMetadata').nil?
|
294
|
+
|
218
295
|
errors = []
|
219
296
|
maindiscover = doc.at_xpath("//rightsMetadata/access[@type='discover' and not(file)]")
|
220
297
|
mainread = doc.at_xpath("//rightsMetadata/access[@type='read' and not(file)]")
|
@@ -243,7 +320,10 @@ module Dor
|
|
243
320
|
def self.extract_index_terms(doc)
|
244
321
|
terms = []
|
245
322
|
machine = doc.at_xpath("//rightsMetadata/access[@type='read' and not(file)]/machine")
|
246
|
-
|
323
|
+
if doc.at_xpath("//rightsMetadata/access[@type='discover']/machine/none") ||
|
324
|
+
doc.at_xpath("//rightsMetadata/access[@type='discover']/machine[not(*)]")
|
325
|
+
terms.push 'none_discover'
|
326
|
+
end
|
247
327
|
terms.push 'world_discover' if doc.at_xpath("//rightsMetadata/access[@type='discover']/machine/world[not(@rule)]")
|
248
328
|
return terms if machine.nil?
|
249
329
|
|
@@ -257,11 +337,22 @@ module Dor
|
|
257
337
|
terms.push "group|#{machine.at_xpath('./group').value.downcase}"
|
258
338
|
end
|
259
339
|
|
340
|
+
['location', 'agent'].each do |access_type|
|
341
|
+
if machine.at_xpath("./#{access_type}")
|
342
|
+
terms.push access_type
|
343
|
+
terms.push "#{access_type}_with_rule" if machine.at_xpath("./#{access_type}")
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
terms.push 'none_read_file' if doc.at_xpath("//rightsMetadata/access[@type='read' and file]/machine/none")
|
348
|
+
|
260
349
|
if machine.at_xpath('./none')
|
261
350
|
terms.push 'none_read'
|
262
351
|
elsif machine.at_xpath('./world')
|
263
352
|
terms.push 'world_read'
|
264
353
|
terms.push "world|#{machine.at_xpath('./world/@rule').value.downcase}" if machine.at_xpath('./world/@rule')
|
354
|
+
elsif machine.at_xpath('./cdl')
|
355
|
+
terms.push 'cdl_none'
|
265
356
|
end
|
266
357
|
|
267
358
|
# now some statistical generation
|
@@ -293,12 +384,26 @@ module Dor
|
|
293
384
|
# :errors => [...], # known error cases
|
294
385
|
# :terms => [...] # array of non-error characterizations and stats strings
|
295
386
|
# }
|
296
|
-
def self.
|
387
|
+
def self.init_index_elements(doc)
|
297
388
|
errors = validate_lite(doc)
|
298
389
|
stuff = {
|
299
390
|
:primary => nil,
|
300
|
-
:errors
|
301
|
-
:terms
|
391
|
+
:errors => errors,
|
392
|
+
:terms => [],
|
393
|
+
:obj_groups => [],
|
394
|
+
:obj_locations => [],
|
395
|
+
:obj_agents => [],
|
396
|
+
:file_groups => [],
|
397
|
+
:file_locations => [],
|
398
|
+
:file_agents => [],
|
399
|
+
:obj_world_qualified => [],
|
400
|
+
:obj_groups_qualified => [],
|
401
|
+
:obj_locations_qualified => [],
|
402
|
+
:obj_agents_qualified => [],
|
403
|
+
:file_world_qualified => [],
|
404
|
+
:file_groups_qualified => [],
|
405
|
+
:file_locations_qualified => [],
|
406
|
+
:file_agents_qualified => []
|
302
407
|
}
|
303
408
|
|
304
409
|
if errors.include? 'no_rightsMetadata'
|
@@ -307,22 +412,33 @@ module Dor
|
|
307
412
|
end
|
308
413
|
|
309
414
|
stuff[:terms] = extract_index_terms(doc)
|
310
|
-
|
415
|
+
stuff[:primary] = primary_access_rights stuff[:terms], errors
|
311
416
|
|
312
|
-
|
313
|
-
|
417
|
+
stuff
|
418
|
+
end
|
419
|
+
|
420
|
+
# "primary" access is a somewhat crude way of summarizing a whole
|
421
|
+
# object (possibly with many disparate interacting rights types)
|
422
|
+
# using one rights label. but it should still do a good job of capturing
|
423
|
+
# rights that make more sense at the object level (e.g. 'dark').
|
424
|
+
def self.primary_access_rights(index_terms, errors)
|
425
|
+
has_rule = index_terms.include? 'has_rule'
|
426
|
+
if index_terms.include?('none_discover')
|
427
|
+
'dark'
|
428
|
+
elsif index_terms.include?('cdl_none')
|
429
|
+
'controlled digital lending'
|
314
430
|
elsif errors.include?('no_discover_access') || errors.include?('no_discover_machine')
|
315
|
-
|
316
|
-
elsif errors.include?('no_read_machine') ||
|
317
|
-
|
318
|
-
elsif
|
319
|
-
|
320
|
-
elsif
|
321
|
-
|
431
|
+
'dark'
|
432
|
+
elsif errors.include?('no_read_machine') || index_terms.include?('none_read')
|
433
|
+
'citation'
|
434
|
+
elsif index_terms.include? 'world_read'
|
435
|
+
has_rule ? 'world_qualified' : 'world'
|
436
|
+
elsif index_terms.include?('has_group_rights') ||
|
437
|
+
index_terms.include?('location') || index_terms.include?('agent')
|
438
|
+
has_rule ? 'access_restricted_qualified' : 'access_restricted'
|
322
439
|
else # should never happen, but we might as well note it if it does
|
323
|
-
|
440
|
+
has_rule ? 'UNKNOWN_qualified' : 'UNKNOWN'
|
324
441
|
end
|
325
|
-
stuff
|
326
442
|
end
|
327
443
|
|
328
444
|
# Create a Dor::RightsAuth object from xml
|
@@ -335,22 +451,35 @@ module Dor
|
|
335
451
|
rights.obj_lvl.world = Rights.new
|
336
452
|
|
337
453
|
doc = xml.is_a?(Nokogiri::XML::Document) ? xml.clone : Nokogiri::XML(xml)
|
454
|
+
|
455
|
+
rights.index_elements = init_index_elements(doc) if forindex
|
456
|
+
|
338
457
|
if doc.at_xpath("//rightsMetadata/access[@type='read' and not(file)]/machine/world")
|
339
458
|
rights.obj_lvl.world.value = true
|
340
459
|
rule = doc.at_xpath("//rightsMetadata/access[@type='read' and not(file)]/machine/world/@rule")
|
341
460
|
rights.obj_lvl.world.rule = rule.value if rule
|
461
|
+
rights.index_elements[:obj_world_qualified] << { :rule => (rule ? rule.value : nil) } if forindex
|
342
462
|
else
|
343
463
|
rights.obj_lvl.world.value = false
|
344
464
|
end
|
345
465
|
|
346
|
-
|
347
|
-
|
466
|
+
# TODO: we should also look for the <group rule="no-download">stanford</group> node and parse as needed
|
467
|
+
if doc.at_xpath("//rightsMetadata/access[@type='read' and not(file)]/machine/cdl")
|
468
|
+
rights.obj_lvl.controlled_digital_lending = true
|
469
|
+
else
|
470
|
+
rights.obj_lvl.controlled_digital_lending = false
|
471
|
+
end
|
348
472
|
|
473
|
+
rights.obj_lvl.group = { :stanford => Rights.new }
|
349
474
|
xpath = "//rightsMetadata/access[@type='read' and not(file)]/machine/group[#{CONTAINS_STANFORD_XPATH}]"
|
350
475
|
if doc.at_xpath(xpath)
|
351
476
|
rights.obj_lvl.group[:stanford].value = true
|
352
477
|
rule = doc.at_xpath("#{xpath}/@rule")
|
353
478
|
rights.obj_lvl.group[:stanford].rule = rule.value if rule
|
479
|
+
if forindex
|
480
|
+
rights.index_elements[:obj_groups_qualified] << { :group => 'stanford', :rule => (rule ? rule.value : nil) }
|
481
|
+
rights.index_elements[:obj_groups] << 'stanford'
|
482
|
+
end
|
354
483
|
else
|
355
484
|
rights.obj_lvl.group[:stanford].value = false
|
356
485
|
end
|
@@ -361,6 +490,10 @@ module Dor
|
|
361
490
|
r.value = true
|
362
491
|
r.rule = node['rule']
|
363
492
|
rights.obj_lvl.location[node.content] = r
|
493
|
+
if forindex
|
494
|
+
rights.index_elements[:obj_locations_qualified] << { :location => node.content, :rule => node['rule'] }
|
495
|
+
rights.index_elements[:obj_locations] << node.content
|
496
|
+
end
|
364
497
|
end
|
365
498
|
|
366
499
|
rights.obj_lvl.agent = {}
|
@@ -369,6 +502,10 @@ module Dor
|
|
369
502
|
r.value = true
|
370
503
|
r.rule = node['rule']
|
371
504
|
rights.obj_lvl.agent[node.content] = r
|
505
|
+
if forindex
|
506
|
+
rights.index_elements[:obj_agents_qualified] << { :agent => node.content, :rule => node['rule'] }
|
507
|
+
rights.index_elements[:obj_agents] << node.content
|
508
|
+
end
|
372
509
|
end
|
373
510
|
|
374
511
|
# Initialze embargo_status to false
|
@@ -383,18 +520,33 @@ module Dor
|
|
383
520
|
access_with_files.each do |access_node|
|
384
521
|
stanford_access = Rights.new
|
385
522
|
world_access = Rights.new
|
523
|
+
controlled_digital_lending = Rights.new
|
386
524
|
if access_node.at_xpath("machine/group[#{CONTAINS_STANFORD_XPATH}]")
|
387
525
|
stanford_access.value = true
|
388
526
|
rule = access_node.at_xpath("machine/group[#{CONTAINS_STANFORD_XPATH}]/@rule")
|
389
527
|
stanford_access.rule = rule.value if rule
|
528
|
+
if forindex
|
529
|
+
rights.index_elements[:file_groups_qualified] <<
|
530
|
+
{ :group => 'stanford', :rule => (rule ? rule.value : nil) }
|
531
|
+
rights.index_elements[:file_groups] << 'stanford'
|
532
|
+
end
|
390
533
|
else
|
391
534
|
stanford_access.value = false
|
392
535
|
end
|
393
536
|
|
537
|
+
if access_node.at_xpath('machine/cdl')
|
538
|
+
controlled_digital_lending.value = true
|
539
|
+
rule = access_node.at_xpath('machine/cdl/@rule')
|
540
|
+
controlled_digital_lending.rule = rule.value if rule
|
541
|
+
else
|
542
|
+
controlled_digital_lending.value = false
|
543
|
+
end
|
544
|
+
|
394
545
|
if access_node.at_xpath('machine/world')
|
395
546
|
world_access.value = true
|
396
547
|
rule = access_node.at_xpath('machine/world/@rule')
|
397
548
|
world_access.rule = rule.value if rule
|
549
|
+
rights.index_elements[:file_world_qualified] << { :rule => (rule ? rule.value : nil) } if forindex
|
398
550
|
else
|
399
551
|
world_access.value = false
|
400
552
|
end
|
@@ -405,6 +557,10 @@ module Dor
|
|
405
557
|
r.value = true
|
406
558
|
r.rule = node['rule']
|
407
559
|
file_locations[node.content] = r
|
560
|
+
if forindex
|
561
|
+
rights.index_elements[:file_locations_qualified] << { :location => node.content, :rule => node['rule'] }
|
562
|
+
rights.index_elements[:file_locations] << node.content
|
563
|
+
end
|
408
564
|
end
|
409
565
|
|
410
566
|
file_agents = {}
|
@@ -413,6 +569,10 @@ module Dor
|
|
413
569
|
r.value = true
|
414
570
|
r.rule = node['rule']
|
415
571
|
file_agents[node.content] = r
|
572
|
+
if forindex
|
573
|
+
rights.index_elements[:file_agents_qualified] << { :agent => node.content, :rule => node['rule'] }
|
574
|
+
rights.index_elements[:file_agents] << node.content
|
575
|
+
end
|
416
576
|
end
|
417
577
|
|
418
578
|
access_node.xpath('file').each do |f|
|
@@ -421,11 +581,28 @@ module Dor
|
|
421
581
|
file_rights.group = { :stanford => stanford_access }
|
422
582
|
file_rights.agent = file_agents
|
423
583
|
file_rights.location = file_locations
|
424
|
-
|
584
|
+
file_rights.controlled_digital_lending = controlled_digital_lending
|
425
585
|
rights.file[f.content] = file_rights
|
426
586
|
end
|
427
587
|
end
|
428
588
|
|
589
|
+
if forindex
|
590
|
+
%i[obj_groups
|
591
|
+
obj_locations
|
592
|
+
obj_agents
|
593
|
+
file_groups
|
594
|
+
file_locations
|
595
|
+
file_agents
|
596
|
+
obj_world_qualified
|
597
|
+
obj_groups_qualified
|
598
|
+
obj_locations_qualified
|
599
|
+
obj_agents_qualified
|
600
|
+
file_world_qualified
|
601
|
+
file_groups_qualified
|
602
|
+
file_locations_qualified
|
603
|
+
file_agents_qualified].each { |index_elt| rights.index_elements[index_elt].uniq! }
|
604
|
+
end
|
605
|
+
|
429
606
|
rights
|
430
607
|
end
|
431
608
|
|
metadata
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-rights-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
8
8
|
- Joe Atzberger
|
9
|
+
- Johnathan Martin
|
10
|
+
- Naomi Dushay
|
9
11
|
autorequire:
|
10
12
|
bindir: bin
|
11
13
|
cert_chain: []
|
12
|
-
date:
|
14
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
13
15
|
dependencies:
|
14
16
|
- !ruby/object:Gem::Dependency
|
15
17
|
name: nokogiri
|
@@ -25,6 +27,34 @@ dependencies:
|
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
27
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: codeclimate-test-reporter
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: coveralls
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
28
58
|
- !ruby/object:Gem::Dependency
|
29
59
|
name: rake
|
30
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,7 +84,7 @@ dependencies:
|
|
54
84
|
- !ruby/object:Gem::Version
|
55
85
|
version: '3.0'
|
56
86
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
87
|
+
name: rubocop
|
58
88
|
requirement: !ruby/object:Gem::Requirement
|
59
89
|
requirements:
|
60
90
|
- - ">="
|
@@ -68,7 +98,7 @@ dependencies:
|
|
68
98
|
- !ruby/object:Gem::Version
|
69
99
|
version: '0'
|
70
100
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
101
|
+
name: rubocop-rspec
|
72
102
|
requirement: !ruby/object:Gem::Requirement
|
73
103
|
requirements:
|
74
104
|
- - ">="
|
@@ -97,8 +127,7 @@ dependencies:
|
|
97
127
|
version: '0'
|
98
128
|
description: Parses rightsMetadata xml into a useable object
|
99
129
|
email:
|
100
|
-
-
|
101
|
-
- atz@stanford.edu
|
130
|
+
- dlss-infrastructure-team@lists.stanford.edu
|
102
131
|
executables: []
|
103
132
|
extensions: []
|
104
133
|
extra_rdoc_files: []
|
@@ -121,19 +150,17 @@ require_paths:
|
|
121
150
|
- lib
|
122
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
123
152
|
requirements:
|
124
|
-
- - "
|
153
|
+
- - "~>"
|
125
154
|
- !ruby/object:Gem::Version
|
126
|
-
version: '
|
155
|
+
version: '2.5'
|
127
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
157
|
requirements:
|
129
158
|
- - ">="
|
130
159
|
- !ruby/object:Gem::Version
|
131
160
|
version: 1.3.6
|
132
161
|
requirements: []
|
133
|
-
|
134
|
-
rubygems_version: 2.4.5.1
|
162
|
+
rubygems_version: 3.1.2
|
135
163
|
signing_key:
|
136
164
|
specification_version: 4
|
137
165
|
summary: Parses rightsMetadata xml into a useable object
|
138
166
|
test_files: []
|
139
|
-
has_rdoc:
|