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.
Files changed (71) hide show
  1. checksums.yaml +8 -8
  2. data/bin/dor-indexer +19 -20
  3. data/bin/dor-indexerd +2 -3
  4. data/config/certs/robots-dor-dev.crt +29 -0
  5. data/config/certs/robots-dor-dev.key +27 -0
  6. data/config/dev_console_env.rb +77 -0
  7. data/lib/dor-services.rb +3 -3
  8. data/lib/dor/config.rb +15 -15
  9. data/lib/dor/datastreams/administrative_metadata_ds.rb +5 -5
  10. data/lib/dor/datastreams/content_metadata_ds.rb +181 -225
  11. data/lib/dor/datastreams/datastream_spec_solrizer.rb +1 -1
  12. data/lib/dor/datastreams/default_object_rights_ds.rb +8 -10
  13. data/lib/dor/datastreams/desc_metadata_ds.rb +35 -34
  14. data/lib/dor/datastreams/embargo_metadata_ds.rb +7 -7
  15. data/lib/dor/datastreams/events_ds.rb +11 -11
  16. data/lib/dor/datastreams/geo_metadata_ds.rb +86 -86
  17. data/lib/dor/datastreams/identity_metadata_ds.rb +19 -19
  18. data/lib/dor/datastreams/role_metadata_ds.rb +3 -3
  19. data/lib/dor/datastreams/simple_dublin_core_ds.rb +13 -13
  20. data/lib/dor/datastreams/version_metadata_ds.rb +5 -5
  21. data/lib/dor/datastreams/workflow_definition_ds.rb +21 -21
  22. data/lib/dor/migrations/identifiable/assert_adminPolicy.rb +1 -1
  23. data/lib/dor/migrations/identifiable/fix_model_assertions.rb +1 -1
  24. data/lib/dor/migrations/identifiable/record_remediation.rb +2 -2
  25. data/lib/dor/migrations/identifiable/uriify_augmented_contentlocation_refs.rb +1 -1
  26. data/lib/dor/migrations/identifiable/uriify_contentlocation_refs.rb +1 -1
  27. data/lib/dor/migrations/processable/unify_workflows.rb +4 -4
  28. data/lib/dor/migrations/versionable/add_missing_version_md.rb +1 -1
  29. data/lib/dor/models/admin_policy_object.rb +1 -1
  30. data/lib/dor/models/assembleable.rb +5 -5
  31. data/lib/dor/models/contentable.rb +27 -27
  32. data/lib/dor/models/describable.rb +168 -179
  33. data/lib/dor/models/discoverable.rb +13 -13
  34. data/lib/dor/models/editable.rb +55 -55
  35. data/lib/dor/models/embargoable.rb +26 -26
  36. data/lib/dor/models/eventable.rb +3 -3
  37. data/lib/dor/models/geoable.rb +8 -8
  38. data/lib/dor/models/governable.rb +14 -14
  39. data/lib/dor/models/identifiable.rb +117 -143
  40. data/lib/dor/models/item.rb +2 -2
  41. data/lib/dor/models/itemizable.rb +9 -9
  42. data/lib/dor/models/presentable.rb +8 -8
  43. data/lib/dor/models/preservable.rb +4 -4
  44. data/lib/dor/models/processable.rb +22 -23
  45. data/lib/dor/models/releaseable.rb +26 -26
  46. data/lib/dor/models/shelvable.rb +14 -14
  47. data/lib/dor/models/upgradable.rb +13 -13
  48. data/lib/dor/models/versionable.rb +2 -2
  49. data/lib/dor/models/workflow_object.rb +4 -4
  50. data/lib/dor/services/cleanup_reset_service.rb +27 -27
  51. data/lib/dor/services/cleanup_service.rb +4 -7
  52. data/lib/dor/services/digital_stacks_service.rb +10 -10
  53. data/lib/dor/services/merge_service.rb +1 -1
  54. data/lib/dor/services/metadata_handlers/mdtoolkit_handler.rb +2 -2
  55. data/lib/dor/services/metadata_service.rb +20 -20
  56. data/lib/dor/services/registration_service.rb +27 -27
  57. data/lib/dor/services/reset_workspace_service.rb +15 -15
  58. data/lib/dor/services/sdr_ingest_service.rb +6 -6
  59. data/lib/dor/services/search_service.rb +2 -2
  60. data/lib/dor/services/suri_service.rb +5 -5
  61. data/lib/dor/services/technical_metadata_service.rb +2 -3
  62. data/lib/dor/utils/ng_tidy.rb +9 -9
  63. data/lib/dor/utils/predicate_patch.rb +1 -1
  64. data/lib/dor/utils/solr_doc_helper.rb +2 -2
  65. data/lib/dor/version.rb +1 -1
  66. data/lib/dor/workflow/document.rb +19 -19
  67. data/lib/dor/workflow/graph.rb +36 -36
  68. data/lib/dor/workflow/process.rb +12 -12
  69. data/lib/tasks/dor.rake +1 -1
  70. data/lib/tasks/rdoc.rake +3 -3
  71. metadata +6 -3
@@ -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=:workgroup
22
- xml=self.roleMetadata.ng_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
- self.roleMetadata.content=xml.to_s
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=self.roleMetadata.ng_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
- return self.descMetadata.term_values(:title_info, :main_title).first
58
+ descMetadata.term_values(:title_info, :main_title).first
59
59
  end
60
60
  def mods_title=(val)
61
- self.descMetadata.update_values({[:title_info, :main_title] => val})
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
- return administrativeMetadata.term_values(:registration, :default_collection)
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=self.administrativeMetadata
71
+ ds=administrativeMetadata
72
72
  xml=ds.ng_xml
73
73
  reg=xml.search('//administrativeMetadata/registration').first
74
- if not reg
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
- self.administrativeMetadata.content=xml.to_s
81
+ administrativeMetadata.content=xml.to_s
82
82
  end
83
-
83
+
84
84
  def remove_default_collection val
85
- ds=self.administrativeMetadata
85
+ ds=administrativeMetadata
86
86
  xml=ds.ng_xml
87
87
  xml.search('//administrativeMetadata/registration/collection[@id=\''+val+'\']').remove
88
- self.administrativeMetadata.content=xml.to_s
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
- self.roleMetadata.ng_xml.search('/roleMetadata/role').each do |role|
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
- self.administrativeMetadata.metadata_source.first
102
+ def metadata_source
103
+ administrativeMetadata.metadata_source.first
104
104
  end
105
105
  def metadata_source=(val)
106
- if self.administrativeMetadata.descMetadata == nil
107
- self.administrativeMetadata.add_child_node(self.administrativeMetadata, :descMetadata)
106
+ if administrativeMetadata.descMetadata.nil?
107
+ administrativeMetadata.add_child_node(administrativeMetadata, :descMetadata)
108
108
  end
109
- self.administrativeMetadata.update_values({[:descMetadata, :source] => val})
109
+ administrativeMetadata.update_values({[:descMetadata, :source] => val})
110
110
  end
111
111
  def use_statement
112
- self.defaultObjectRights.use_statement.first
112
+ defaultObjectRights.use_statement.first
113
113
  end
114
114
  def use_statement=(val)
115
- self.defaultObjectRights.update_values({[:use_statement] => val})
115
+ defaultObjectRights.update_values({[:use_statement] => val})
116
116
  end
117
117
  def copyright_statement
118
- self.defaultObjectRights.copyright.first
118
+ defaultObjectRights.copyright.first
119
119
  end
120
120
  def copyright_statement=(val)
121
- self.defaultObjectRights.update_values({[:copyright] => val})
121
+ defaultObjectRights.update_values({[:copyright] => val})
122
122
  end
123
123
  def creative_commons_license
124
- self.defaultObjectRights.creative_commons.first
124
+ defaultObjectRights.creative_commons.first
125
125
  end
126
126
  def creative_commons_license_human
127
- self.defaultObjectRights.creative_commons_human.first
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 == nil
132
- self.defaultObjectRights.add_child_node(self.defaultObjectRights.ng_xml.root, :creative_commons)
131
+ if creative_commons_license.nil?
132
+ defaultObjectRights.add_child_node(defaultObjectRights.ng_xml.root, :creative_commons)
133
133
  end
134
- self.defaultObjectRights.update_values({[:creative_commons] => val})
134
+ defaultObjectRights.update_values({[:creative_commons] => val})
135
135
  end
136
136
  def creative_commons_license_human=(val)
137
- if creative_commons_license_human == nil
137
+ if creative_commons_license_human.nil?
138
138
  #add the nodes
139
- self.defaultObjectRights.add_child_node(self.defaultObjectRights.ng_xml.root, :creative_commons)
139
+ defaultObjectRights.add_child_node(defaultObjectRights.ng_xml.root, :creative_commons)
140
140
  end
141
- self.defaultObjectRights.update_values({[:creative_commons_human] => val})
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=self.defaultObjectRights.ng_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 = self.defaultObjectRights
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
- self.administrativeMetadata.metadata_format.first
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
- if not self.administrativeMetadata.metadata_format.first
207
- self.administrativeMetadata.add_child_node(self.administrativeMetadata.ng_xml.root, :metadata_format)
206
+ unless administrativeMetadata.metadata_format.first
207
+ administrativeMetadata.add_child_node(administrativeMetadata.ng_xml.root, :metadata_format)
208
208
  end
209
- self.administrativeMetadata.update_values({[:metadata_format] => format})
209
+ administrativeMetadata.update_values({[:metadata_format] => format})
210
210
  end
211
211
  def desc_metadata_source
212
- self.administrativeMetadata.metadata_source.first
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
- if not self.administrativeMetadata.metadata_source.first
217
- self.administrativeMetadata.add_child_node(self.administrativeMetadata.ng_xml.root, :metadata_source)
216
+ unless administrativeMetadata.metadata_source.first
217
+ administrativeMetadata.add_child_node(administrativeMetadata.ng_xml.root, :metadata_source)
218
218
  end
219
- self.administrativeMetadata.update_values({[:metadata_source] => format})
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=self.administrativeMetadata.ng_xml
225
- nodes=self.administrativeMetadata.term_values(:registration, :workflow_id)
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=self.administrativeMetadata
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
- if not nodes.first
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
- return builder.doc
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
- def update_embargo(new_date)
75
- if not 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
- self.rightsMetadata.ng_xml.search('//embargoReleaseDate').each do |node|
83
- node.content=new_date.beginning_of_day.utc.xmlschema
84
- updated=true
85
- end
86
- self.rightsMetadata.content=self.rightsMetadata.ng_xml.to_s
87
- self.rightsMetadata.save
88
- if not updated
89
- raise 'No release date in rights metadata, cannot proceed!'
90
- end
91
- self.embargoMetadata.ng_xml.xpath('//releaseDate').each do |node|
92
- node.content=new_date.beginning_of_day.utc.xmlschema
93
- end
94
- self.embargoMetadata.content=self.embargoMetadata.ng_xml.to_s
95
- self.embargoMetadata.save
96
- end
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
@@ -4,9 +4,9 @@ module Dor
4
4
  included do
5
5
  has_metadata :name => 'events', :type => Dor::EventsDS, :label => 'Events'
6
6
  end
7
-
7
+
8
8
  def add_event *args
9
- self.datastreams['events'].add_event *args
9
+ datastreams['events'].add_event *args
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -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 = self.datastreams['identityMetadata'].otherId.collect { |oid| oid.to_s }
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 = self.label
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
- self.initialize_workflow(name, !self.new_object?)
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 self.admin_policy_object.nil? # TODO log warning?
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? or lane.strip == ''
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 = self.rightsMetadata
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 if not ['world','stanford','none', 'dark'].include? rights
36
- rights_metadata_ds = self.rightsMetadata
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' or rights == 'dark'
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
- self.collections << collection
83
- self.sets << collection
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
- self.collections.delete(collection)
96
- self.sets.delete(collection)
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=self.rightsMetadata.ng_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
- return (arr1 & arr2).length > 0
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