Skip to content

Commit

Permalink
fix rights for basic resource importer under v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed Aug 31, 2017
1 parent 4d18c63 commit a4ead13
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions backend/converters/basic_resource_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,39 @@ def create_resource(row)


def format_rights_statement(row)
{
:rights_type => 'institutional_policy',
:permissions => row['access_conditions'],
:restrictions => row['use_conditions'],
:granted_note => row['granted_note']
}
if ASConstants.VERSION.start_with?('v1')
{
:rights_type => 'institutional_policy',
:permissions => row['access_conditions'],
:restrictions => row['use_conditions'],
:granted_note => row['granted_note']
}
else
notes = []
if row['access_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Access Conditions (eg Available for Reference. Not for Loan)",
:type => 'additional_information',
:content => [ row['access_conditions'] ]
}
end
if row['use_conditions']
notes << {
:jsonmodel_type => "note_rights_statement",
:label => "Use Conditions (eg copying not permitted)",
:type => 'additional_information',
:content => [ row['use_conditions'] ]
}
end

{
:rights_type => 'other',
:other_rights_basis => 'donor',
:start_date => Time.now.to_date.iso8601,
:notes => notes
}
end
end


Expand Down

0 comments on commit a4ead13

Please sign in to comment.