dor-services 4.22.3 → 4.22.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/dor-indexer +19 -20
- data/bin/dor-indexerd +2 -3
- data/config/certs/robots-dor-dev.crt +29 -0
- data/config/certs/robots-dor-dev.key +27 -0
- data/config/dev_console_env.rb +77 -0
- data/lib/dor-services.rb +3 -3
- data/lib/dor/config.rb +15 -15
- data/lib/dor/datastreams/administrative_metadata_ds.rb +5 -5
- data/lib/dor/datastreams/content_metadata_ds.rb +181 -225
- data/lib/dor/datastreams/datastream_spec_solrizer.rb +1 -1
- data/lib/dor/datastreams/default_object_rights_ds.rb +8 -10
- data/lib/dor/datastreams/desc_metadata_ds.rb +35 -34
- data/lib/dor/datastreams/embargo_metadata_ds.rb +7 -7
- data/lib/dor/datastreams/events_ds.rb +11 -11
- data/lib/dor/datastreams/geo_metadata_ds.rb +86 -86
- data/lib/dor/datastreams/identity_metadata_ds.rb +19 -19
- data/lib/dor/datastreams/role_metadata_ds.rb +3 -3
- data/lib/dor/datastreams/simple_dublin_core_ds.rb +13 -13
- data/lib/dor/datastreams/version_metadata_ds.rb +5 -5
- data/lib/dor/datastreams/workflow_definition_ds.rb +21 -21
- data/lib/dor/migrations/identifiable/assert_adminPolicy.rb +1 -1
- data/lib/dor/migrations/identifiable/fix_model_assertions.rb +1 -1
- data/lib/dor/migrations/identifiable/record_remediation.rb +2 -2
- data/lib/dor/migrations/identifiable/uriify_augmented_contentlocation_refs.rb +1 -1
- data/lib/dor/migrations/identifiable/uriify_contentlocation_refs.rb +1 -1
- data/lib/dor/migrations/processable/unify_workflows.rb +4 -4
- data/lib/dor/migrations/versionable/add_missing_version_md.rb +1 -1
- data/lib/dor/models/admin_policy_object.rb +1 -1
- data/lib/dor/models/assembleable.rb +5 -5
- data/lib/dor/models/contentable.rb +27 -27
- data/lib/dor/models/describable.rb +168 -179
- data/lib/dor/models/discoverable.rb +13 -13
- data/lib/dor/models/editable.rb +55 -55
- data/lib/dor/models/embargoable.rb +26 -26
- data/lib/dor/models/eventable.rb +3 -3
- data/lib/dor/models/geoable.rb +8 -8
- data/lib/dor/models/governable.rb +14 -14
- data/lib/dor/models/identifiable.rb +117 -143
- data/lib/dor/models/item.rb +2 -2
- data/lib/dor/models/itemizable.rb +9 -9
- data/lib/dor/models/presentable.rb +8 -8
- data/lib/dor/models/preservable.rb +4 -4
- data/lib/dor/models/processable.rb +22 -23
- data/lib/dor/models/releaseable.rb +26 -26
- data/lib/dor/models/shelvable.rb +14 -14
- data/lib/dor/models/upgradable.rb +13 -13
- data/lib/dor/models/versionable.rb +2 -2
- data/lib/dor/models/workflow_object.rb +4 -4
- data/lib/dor/services/cleanup_reset_service.rb +27 -27
- data/lib/dor/services/cleanup_service.rb +4 -7
- data/lib/dor/services/digital_stacks_service.rb +10 -10
- data/lib/dor/services/merge_service.rb +1 -1
- data/lib/dor/services/metadata_handlers/mdtoolkit_handler.rb +2 -2
- data/lib/dor/services/metadata_service.rb +20 -20
- data/lib/dor/services/registration_service.rb +27 -27
- data/lib/dor/services/reset_workspace_service.rb +15 -15
- data/lib/dor/services/sdr_ingest_service.rb +6 -6
- data/lib/dor/services/search_service.rb +2 -2
- data/lib/dor/services/suri_service.rb +5 -5
- data/lib/dor/services/technical_metadata_service.rb +2 -3
- data/lib/dor/utils/ng_tidy.rb +9 -9
- data/lib/dor/utils/predicate_patch.rb +1 -1
- data/lib/dor/utils/solr_doc_helper.rb +2 -2
- data/lib/dor/version.rb +1 -1
- data/lib/dor/workflow/document.rb +19 -19
- data/lib/dor/workflow/graph.rb +36 -36
- data/lib/dor/workflow/process.rb +12 -12
- data/lib/tasks/dor.rake +1 -1
- data/lib/tasks/rdoc.rake +3 -3
- metadata +6 -3
data/lib/dor/models/editable.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module Dor
|
1
|
+
module Dor
|
2
2
|
module Editable
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
include ActiveFedora::Relationships
|
@@ -6,8 +6,8 @@ module Dor
|
|
6
6
|
included do
|
7
7
|
belongs_to 'agreement_object', :property => :referencesAgreement, :class_name => "Dor::Item"
|
8
8
|
end
|
9
|
-
|
10
|
-
def to_solr(solr_doc=Hash.new, *args)
|
9
|
+
|
10
|
+
def to_solr(solr_doc = Hash.new, *args)
|
11
11
|
super(solr_doc, *args)
|
12
12
|
add_solr_value(solr_doc, "default_rights", default_rights, :string, [:facetable])
|
13
13
|
add_solr_value(solr_doc, "agreement", agreement, :string, [:facetable]) if agreement_object
|
@@ -18,8 +18,8 @@ module Dor
|
|
18
18
|
#@param role [String] the role the group or person will be filed under, ex. dor-apo-manager
|
19
19
|
#@param entity [String] the name of the person or group, ex dlss:developers or sunetid:someone
|
20
20
|
#@param type [Symbol] :workgroup for a group or :person for a person
|
21
|
-
def add_roleplayer role, entity, type
|
22
|
-
xml=
|
21
|
+
def add_roleplayer role, entity, type = :workgroup
|
22
|
+
xml=roleMetadata.ng_xml
|
23
23
|
group='person'
|
24
24
|
if type == :workgroup
|
25
25
|
group='group'
|
@@ -43,11 +43,11 @@ module Dor
|
|
43
43
|
id_node['type']=type.to_s
|
44
44
|
xml.search('/roleMetadata').first.add_child(node)
|
45
45
|
end
|
46
|
-
|
46
|
+
roleMetadata.content=xml.to_s
|
47
47
|
end
|
48
48
|
#remove all people groups and roles from the APO role metadata datastream
|
49
|
-
def purge_roles
|
50
|
-
xml=
|
49
|
+
def purge_roles
|
50
|
+
xml=roleMetadata.ng_xml
|
51
51
|
nodes = xml.search('/roleMetadata/role')
|
52
52
|
nodes.each do |node|
|
53
53
|
node.remove
|
@@ -55,43 +55,43 @@ module Dor
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def mods_title
|
58
|
-
|
58
|
+
descMetadata.term_values(:title_info, :main_title).first
|
59
59
|
end
|
60
60
|
def mods_title=(val)
|
61
|
-
|
61
|
+
descMetadata.update_values({[:title_info, :main_title] => val})
|
62
62
|
end
|
63
63
|
#get all collections listed for this APO, used during registration
|
64
64
|
#@return [Array] array of pids
|
65
|
-
def default_collections
|
66
|
-
|
65
|
+
def default_collections
|
66
|
+
administrativeMetadata.term_values(:registration, :default_collection)
|
67
67
|
end
|
68
|
-
#Add a collection to the listing of collections for items governed by this apo.
|
68
|
+
#Add a collection to the listing of collections for items governed by this apo.
|
69
69
|
#@param val [String] pid of the collection, ex. druid:ab123cd4567
|
70
70
|
def add_default_collection val
|
71
|
-
ds=
|
71
|
+
ds=administrativeMetadata
|
72
72
|
xml=ds.ng_xml
|
73
73
|
reg=xml.search('//administrativeMetadata/registration').first
|
74
|
-
|
74
|
+
unless reg
|
75
75
|
reg=Nokogiri::XML::Node.new('registration',xml)
|
76
76
|
xml.search('/administrativeMetadata').first.add_child(reg)
|
77
77
|
end
|
78
78
|
node=Nokogiri::XML::Node.new('collection',xml)
|
79
79
|
node['id']=val
|
80
80
|
reg.add_child(node)
|
81
|
-
|
81
|
+
administrativeMetadata.content=xml.to_s
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
def remove_default_collection val
|
85
|
-
ds=
|
85
|
+
ds=administrativeMetadata
|
86
86
|
xml=ds.ng_xml
|
87
87
|
xml.search('//administrativeMetadata/registration/collection[@id=\''+val+'\']').remove
|
88
|
-
|
88
|
+
administrativeMetadata.content=xml.to_s
|
89
89
|
end
|
90
90
|
#Get all roles defined in the role metadata, and the people or groups in those roles. Groups are prefixed with 'workgroup:'
|
91
91
|
#@return [Hash] role => ['person','group'] ex. {"dor-apo-manager" => ["workgroup:dlss:developers", "sunetid:lmcrae"]
|
92
92
|
def roles
|
93
93
|
roles={}
|
94
|
-
|
94
|
+
roleMetadata.ng_xml.search('/roleMetadata/role').each do |role|
|
95
95
|
roles[role['type']]=[]
|
96
96
|
role.search('identifier').each do |entity|
|
97
97
|
roles[role['type']] << entity['type'] + ':' + entity.text()
|
@@ -99,51 +99,51 @@ module Dor
|
|
99
99
|
end
|
100
100
|
roles
|
101
101
|
end
|
102
|
-
def metadata_source
|
103
|
-
|
102
|
+
def metadata_source
|
103
|
+
administrativeMetadata.metadata_source.first
|
104
104
|
end
|
105
105
|
def metadata_source=(val)
|
106
|
-
if
|
107
|
-
|
106
|
+
if administrativeMetadata.descMetadata.nil?
|
107
|
+
administrativeMetadata.add_child_node(administrativeMetadata, :descMetadata)
|
108
108
|
end
|
109
|
-
|
109
|
+
administrativeMetadata.update_values({[:descMetadata, :source] => val})
|
110
110
|
end
|
111
111
|
def use_statement
|
112
|
-
|
112
|
+
defaultObjectRights.use_statement.first
|
113
113
|
end
|
114
114
|
def use_statement=(val)
|
115
|
-
|
115
|
+
defaultObjectRights.update_values({[:use_statement] => val})
|
116
116
|
end
|
117
117
|
def copyright_statement
|
118
|
-
|
118
|
+
defaultObjectRights.copyright.first
|
119
119
|
end
|
120
120
|
def copyright_statement=(val)
|
121
|
-
|
121
|
+
defaultObjectRights.update_values({[:copyright] => val})
|
122
122
|
end
|
123
123
|
def creative_commons_license
|
124
|
-
|
124
|
+
defaultObjectRights.creative_commons.first
|
125
125
|
end
|
126
126
|
def creative_commons_license_human
|
127
|
-
|
127
|
+
defaultObjectRights.creative_commons_human.first
|
128
128
|
end
|
129
129
|
def creative_commons_license=(val)
|
130
130
|
(machine, human)=val
|
131
|
-
if creative_commons_license
|
132
|
-
|
131
|
+
if creative_commons_license.nil?
|
132
|
+
defaultObjectRights.add_child_node(defaultObjectRights.ng_xml.root, :creative_commons)
|
133
133
|
end
|
134
|
-
|
134
|
+
defaultObjectRights.update_values({[:creative_commons] => val})
|
135
135
|
end
|
136
136
|
def creative_commons_license_human=(val)
|
137
|
-
if creative_commons_license_human
|
137
|
+
if creative_commons_license_human.nil?
|
138
138
|
#add the nodes
|
139
|
-
|
139
|
+
defaultObjectRights.add_child_node(defaultObjectRights.ng_xml.root, :creative_commons)
|
140
140
|
end
|
141
|
-
|
142
|
-
|
141
|
+
defaultObjectRights.update_values({[:creative_commons_human] => val})
|
142
|
+
|
143
143
|
end
|
144
144
|
#@return [String] A description of the rights defined in the default object rights datastream. Can be 'Stanford', 'World', 'Dark' or 'None'
|
145
145
|
def default_rights
|
146
|
-
xml=
|
146
|
+
xml=defaultObjectRights.ng_xml
|
147
147
|
if xml.search('//rightsMetadata/access[@type=\'read\']/machine/group').length == 1
|
148
148
|
'Stanford'
|
149
149
|
else
|
@@ -162,7 +162,7 @@ module Dor
|
|
162
162
|
#@param rights [String] Stanford, World, Dark, or None
|
163
163
|
def default_rights=(rights)
|
164
164
|
rights=rights.downcase
|
165
|
-
ds =
|
165
|
+
ds = defaultObjectRights
|
166
166
|
rights_xml=ds.ng_xml
|
167
167
|
rights_xml.search('//rightsMetadata/access[@type=\'discover\']/machine').each do |node|
|
168
168
|
node.children.remove
|
@@ -197,32 +197,32 @@ module Dor
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
end
|
200
|
-
|
200
|
+
|
201
201
|
def desc_metadata_format
|
202
|
-
|
202
|
+
administrativeMetadata.metadata_format.first
|
203
203
|
end
|
204
204
|
def desc_metadata_format=(format)
|
205
205
|
#create the node if it isnt there already
|
206
|
-
|
207
|
-
|
206
|
+
unless administrativeMetadata.metadata_format.first
|
207
|
+
administrativeMetadata.add_child_node(administrativeMetadata.ng_xml.root, :metadata_format)
|
208
208
|
end
|
209
|
-
|
209
|
+
administrativeMetadata.update_values({[:metadata_format] => format})
|
210
210
|
end
|
211
211
|
def desc_metadata_source
|
212
|
-
|
212
|
+
administrativeMetadata.metadata_source.first
|
213
213
|
end
|
214
214
|
def desc_metadata_source=(source)
|
215
215
|
#create the node if it isnt there already
|
216
|
-
|
217
|
-
|
216
|
+
unless administrativeMetadata.metadata_source.first
|
217
|
+
administrativeMetadata.add_child_node(administrativeMetadata.ng_xml.root, :metadata_source)
|
218
218
|
end
|
219
|
-
|
219
|
+
administrativeMetadata.update_values({[:metadata_source] => format})
|
220
220
|
end
|
221
221
|
#List of default workflows, used to provide choices at registration
|
222
222
|
#@return [Array] and array of pids, ex ['druid:ab123cd4567']
|
223
223
|
def default_workflows
|
224
|
-
xml=
|
225
|
-
nodes=
|
224
|
+
xml=administrativeMetadata.ng_xml
|
225
|
+
nodes=administrativeMetadata.term_values(:registration, :workflow_id)
|
226
226
|
if nodes.length > 0
|
227
227
|
wfs=[]
|
228
228
|
nodes.each do |node|
|
@@ -231,19 +231,19 @@ module Dor
|
|
231
231
|
wfs
|
232
232
|
else
|
233
233
|
[]
|
234
|
-
end
|
234
|
+
end
|
235
235
|
end
|
236
236
|
#set a single default workflow
|
237
237
|
#@param wf [String] the name of the workflow, ex. 'digitizationWF'
|
238
238
|
def default_workflow=(wf)
|
239
|
-
ds=
|
239
|
+
ds=administrativeMetadata
|
240
240
|
xml=ds.ng_xml
|
241
241
|
nodes=xml.search('//registration/workflow')
|
242
242
|
if nodes.first
|
243
243
|
nodes.first['id']=wf
|
244
244
|
else
|
245
245
|
nodes=xml.search('//registration')
|
246
|
-
|
246
|
+
unless nodes.first
|
247
247
|
reg_node=Nokogiri::XML::Node.new('registration',xml)
|
248
248
|
xml.root.add_child(reg_node)
|
249
249
|
end
|
@@ -254,7 +254,7 @@ module Dor
|
|
254
254
|
end
|
255
255
|
end
|
256
256
|
def agreement
|
257
|
-
if agreement_object
|
257
|
+
if agreement_object
|
258
258
|
agreement_object.pid
|
259
259
|
else
|
260
260
|
''
|
@@ -15,7 +15,7 @@ module Dor
|
|
15
15
|
# Modifies rightsMetadata to remove embargoReleaseDate and updates/adds access from embargoMetadata/releaseAccess
|
16
16
|
# @param [String] release_agent name of the person, application or thing that released embargo
|
17
17
|
# @note The caller should save the object to fedora to commit the changes
|
18
|
-
def release_embargo(release_agent="unknown")
|
18
|
+
def release_embargo(release_agent = "unknown")
|
19
19
|
# Set status to released
|
20
20
|
embargo_md = datastreams['embargoMetadata']
|
21
21
|
embargo_md.status = 'released'
|
@@ -47,10 +47,10 @@ module Dor
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
end
|
50
|
-
|
50
|
+
builder.doc
|
51
51
|
end
|
52
52
|
|
53
|
-
def release_20_pct_vis_embargo(release_agent="unknown")
|
53
|
+
def release_20_pct_vis_embargo(release_agent = "unknown")
|
54
54
|
# Set status to released
|
55
55
|
embargo_md = datastreams['embargoMetadata']
|
56
56
|
embargo_md.twenty_pct_status = 'released'
|
@@ -71,28 +71,28 @@ module Dor
|
|
71
71
|
datastreams['events'].add_event("embargo", release_agent, "20% Visibility Embargo released")
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
74
|
+
def update_embargo(new_date)
|
75
|
+
unless embargoMetadata.status == 'embargoed'
|
76
|
+
raise 'You cannot change the embargo date of an item thant isnt embargoed.'
|
77
|
+
end
|
78
|
+
if new_date.past?
|
79
|
+
raise 'You cannot set the embargo date to a past date.'
|
80
|
+
end
|
81
|
+
updated=false
|
82
|
+
rightsMetadata.ng_xml.search('//embargoReleaseDate').each do |node|
|
83
|
+
node.content=new_date.beginning_of_day.utc.xmlschema
|
84
|
+
updated=true
|
85
|
+
end
|
86
|
+
rightsMetadata.content=rightsMetadata.ng_xml.to_s
|
87
|
+
rightsMetadata.save
|
88
|
+
unless updated
|
89
|
+
raise 'No release date in rights metadata, cannot proceed!'
|
90
|
+
end
|
91
|
+
embargoMetadata.ng_xml.xpath('//releaseDate').each do |node|
|
92
|
+
node.content=new_date.beginning_of_day.utc.xmlschema
|
93
|
+
end
|
94
|
+
embargoMetadata.content=embargoMetadata.ng_xml.to_s
|
95
|
+
embargoMetadata.save
|
96
|
+
end
|
97
97
|
end
|
98
98
|
end
|
data/lib/dor/models/eventable.rb
CHANGED
data/lib/dor/models/geoable.rb
CHANGED
@@ -3,18 +3,18 @@ module Dor
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
include SolrDocHelper
|
5
5
|
|
6
|
-
class CrosswalkError < Exception; end
|
7
|
-
|
6
|
+
class CrosswalkError < Exception; end
|
7
|
+
|
8
8
|
included do
|
9
|
-
has_metadata :name => 'geoMetadata',
|
10
|
-
:type => Dor::GeoMetadataDS,
|
11
|
-
:label => 'Geographic Information Metadata in ISO 19139',
|
9
|
+
has_metadata :name => 'geoMetadata',
|
10
|
+
:type => Dor::GeoMetadataDS,
|
11
|
+
:label => 'Geographic Information Metadata in ISO 19139',
|
12
12
|
:control_group => 'M'
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
# @return [String] XML
|
16
16
|
def fetch_geoMetadata_datastream
|
17
|
-
candidates =
|
17
|
+
candidates = datastreams['identityMetadata'].otherId.collect { |oid| oid.to_s }
|
18
18
|
metadata_id = Dor::MetadataService.resolvable(candidates).first
|
19
19
|
unless metadata_id.nil?
|
20
20
|
return Dor::MetadataService.fetch(metadata_id.to_s)
|
@@ -26,7 +26,7 @@ module Dor
|
|
26
26
|
def build_geoMetadata_datastream(ds)
|
27
27
|
content = fetch_geoMetadata_datastream
|
28
28
|
unless content.nil?
|
29
|
-
ds.dsLabel =
|
29
|
+
ds.dsLabel = label
|
30
30
|
ds.ng_xml = Nokogiri::XML(content)
|
31
31
|
ds.ng_xml.normalize_text!
|
32
32
|
ds.content = ds.ng_xml.to_xml
|
@@ -10,30 +10,30 @@ module Dor
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def initiate_apo_workflow(name)
|
13
|
-
|
13
|
+
initialize_workflow(name, !self.new_object?)
|
14
14
|
end
|
15
15
|
|
16
16
|
# Returns the default lane_id from the item's APO. Will return 'default' if the item does not have
|
17
17
|
# and APO, or if the APO does not have a default_lane
|
18
18
|
# @return [String] the lane id
|
19
19
|
def default_workflow_lane
|
20
|
-
return 'default' if
|
20
|
+
return 'default' if admin_policy_object.nil? # TODO log warning?
|
21
21
|
|
22
22
|
admin_md = admin_policy_object.datastreams['administrativeMetadata']
|
23
23
|
return 'default' unless admin_md.respond_to? :default_workflow_lane
|
24
24
|
lane = admin_md.default_workflow_lane
|
25
|
-
return 'default' if lane.nil?
|
25
|
+
return 'default' if lane.nil? || lane.strip == ''
|
26
26
|
lane
|
27
27
|
end
|
28
28
|
|
29
29
|
def reset_to_apo_default()
|
30
|
-
rights_metadata_ds =
|
30
|
+
rights_metadata_ds = rightsMetadata
|
31
31
|
rights_metadata_ds.content = admin_policy_object.rightsMetadata.ng_xml
|
32
32
|
end
|
33
33
|
|
34
34
|
def set_read_rights(rights)
|
35
|
-
return
|
36
|
-
rights_metadata_ds =
|
35
|
+
return unless ['world','stanford','none', 'dark'].include? rights
|
36
|
+
rights_metadata_ds = rightsMetadata
|
37
37
|
rights_xml=rights_metadata_ds.ng_xml
|
38
38
|
if(rights_xml.search('//rightsMetadata/access[@type=\'read\']').length==0)
|
39
39
|
raise ('The rights metadata stream doesnt contain an entry for machine read permissions. Consider populating it from the APO before trying to change it.')
|
@@ -64,7 +64,7 @@ module Dor
|
|
64
64
|
node.add_child(machine_node)
|
65
65
|
machine_node.add_child(group_node)
|
66
66
|
end
|
67
|
-
if rights=='none'
|
67
|
+
if rights=='none' || rights == 'dark'
|
68
68
|
none_node=Nokogiri::XML::Node.new('none',rights_xml)
|
69
69
|
node.add_child(machine_node)
|
70
70
|
machine_node.add_child(none_node)
|
@@ -79,8 +79,8 @@ module Dor
|
|
79
79
|
when Dor::Collection
|
80
80
|
collection_or_druid
|
81
81
|
end
|
82
|
-
|
83
|
-
|
82
|
+
collections << collection
|
83
|
+
sets << collection
|
84
84
|
end
|
85
85
|
|
86
86
|
def remove_collection(collection_or_druid)
|
@@ -92,8 +92,8 @@ module Dor
|
|
92
92
|
collection_or_druid
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
collections.delete(collection)
|
96
|
+
sets.delete(collection)
|
97
97
|
end
|
98
98
|
#set the rights metadata datastream to the content of the APO's default object rights
|
99
99
|
def reapplyAdminPolicyObjectDefaults
|
@@ -101,7 +101,7 @@ module Dor
|
|
101
101
|
end
|
102
102
|
def rights
|
103
103
|
return nil unless self.respond_to? :rightsMetadata
|
104
|
-
xml=
|
104
|
+
xml=rightsMetadata.ng_xml
|
105
105
|
return nil if xml.search('//rightsMetadata').length != 1
|
106
106
|
if xml.search('//rightsMetadata/access[@type=\'read\']/machine/group').length == 1
|
107
107
|
'Stanford'
|
@@ -142,7 +142,7 @@ module Dor
|
|
142
142
|
['dor-administrator', 'sdr-administrator', 'dor-apo-manager', 'dor-apo-depositor', 'dor-viewer', 'sdr-viewer']
|
143
143
|
end
|
144
144
|
def intersect arr1, arr2
|
145
|
-
|
145
|
+
(arr1 & arr2).length > 0
|
146
146
|
end
|
147
147
|
def can_manage_item? roles
|
148
148
|
intersect roles, groups_which_manage_item
|
@@ -169,4 +169,4 @@ module Dor
|
|
169
169
|
intersect roles, groups_which_view_metadata
|
170
170
|
end
|
171
171
|
end
|
172
|
-
end
|
172
|
+
end
|