Skip to content

Commit 8f1894b

Browse files
authored
Merge pull request #38 from psu-libraries/add-embargo-option
add fourth embargo option for college of liberal arts
2 parents 97025f8 + 4fa675d commit 8f1894b

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

lib/etda_utilities/access_level.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AccessLevel
1111
# *** IMPORTANT NOTE ***
1212
# The order of the keys in this array matter and they should go from least restrictive to most restrictive
1313
# This is used in the comparison operation (<=>) below
14-
ACCESS_LEVEL_KEYS = ['open_access', 'restricted_to_institution', 'restricted', ''].freeze
14+
ACCESS_LEVEL_KEYS = ['open_access', 'restricted_to_institution', 'restricted_liberal_arts', 'restricted', ''].freeze
1515

1616
# create instances of each type that can be used
1717
# OPEN_ACCESS, RESTRICTED, and RESTRICTED_TO_INSTITUTION (graduate only)

lib/etda_utilities/access_levels_for_partners.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ graduate:
88
restricted_to_institution_attr:
99
description_html: Access restricted to individuals having a valid Penn State Access Account, for a period of two years. Allows restricted access of the entire work beginning immediately after degree conferral. At the end of the two-year period, the status will automatically change to Open Access. <i>Intended for use by authors in cases where prior public release of the work may compromise its acceptance for publication.</i> After the conferral of the degree, abstracts for all doctoral dissertations and master's theses, whether Open Access, Restricted (Penn State) or Restricted, become accessible worldwide.
1010
scope: final_restricted_institution
11+
restricted_liberal_arts: 'Restricted (Liberal Arts Only)'
12+
restricted_liberal_arts_attr:
13+
description_html: 'Immediately after the conferral of the degree, the abstract becomes accessible worldwide. All other parts of the document are restricted to Penn State only for an embargo period of five (5) years for dissertations from the College of the Liberal Arts. No extensions will be granted beyond five (5) years.'
14+
scope: final_restricted_liberal_arts
1115
restricted: 'Restricted'
1216
restricted_attr:
1317
description_html: Restricts the entire work for the purpose of filing a patent. At the end of the two-year period, the status will automatically change to Open Access. Selection of this option requires that an invention disclosure (ID) be filed with the Office of Technology Management (OTM) prior to submission of the final thesis/dissertation, and confirmed by OTM. After the conferral of the degree, abstracts for all doctoral dissertations and master's theses, whether Open Access, Restricted (Penn State) or Restricted, become accessible worldwide.

lib/etda_utilities/etda_file_paths.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module EtdaUtilities
44
class EtdaFilePaths
55
RESTRICTED_DIR = 'restricted'
66
RESTRICTED_INSTITUTION_DIR = 'restricted_institution'
7+
RESTRICTED_LIBERAL_ARTS_DIR = 'restricted_liberal_arts'
78
OPEN_DIR = 'open_access'
89

910
def workflow_base_path
@@ -34,6 +35,10 @@ def explore_psu_only
3435
"#{explore_base_path}#{RESTRICTED_INSTITUTION_DIR}/"
3536
end
3637

38+
def explore_liberal_arts_only
39+
"#{explore_base_path}#{RESTRICTED_LIBERAL_ARTS_DIR}/"
40+
end
41+
3742
def detailed_file_path(file_id)
3843
str1 = format("%02d", ((file_id.to_i || 0) % 100))
3944
str2 = file_id.to_s
@@ -49,6 +54,8 @@ def explore_download_file_path(file_id, access_level, filename)
4954

5055
return explore_psu_only + detailed_file_path(file_id) + filename if access_level == 'restricted_to_institution'
5156

57+
return explore_liberal_arts_only + detailed_file_path(file_id) + filename if access_level == 'restricted_liberal_arts'
58+
5259
nil
5360
end
5461
end

spec/lib/etda_utilities_access_level_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe 'AccessLevel' do
55
describe '#ACCESS_LEVEL_KEYS' do
66
it 'constant containing all access levels' do
7-
expect(described_class::ACCESS_LEVEL_KEYS).to contain_exactly('open_access', 'restricted_to_institution', 'restricted', '')
7+
expect(described_class::ACCESS_LEVEL_KEYS).to contain_exactly('open_access', 'restricted_to_institution', 'restricted_liberal_arts', 'restricted', '')
88
end
99
end
1010

@@ -19,6 +19,7 @@
1919
yml_level = described_class.partner_access_levels['access_level']
2020
expect(yml_level['open_access']).to include('Open Access')
2121
expect(yml_level['restricted_to_institution']).to include('Restricted (Penn State Only)')
22+
expect(yml_level['restricted_liberal_arts']).to include('Restricted (Liberal Arts Only)')
2223
expect(yml_level['restricted']).to include('Restricted')
2324
end
2425
end
@@ -45,6 +46,9 @@
4546
restricted_to_institution = described_class.new('restricted_to_institution')
4647
expect(restricted_to_institution.attributes).to eq('Restricted (Penn State Only)')
4748
expect(restricted_to_institution.current_access_level).to eq('restricted_to_institution')
49+
restricted_liberal_arts = described_class.new('restricted_liberal_arts')
50+
expect(restricted_liberal_arts.attributes).to eq('Restricted (Liberal Arts Only)')
51+
expect(restricted_liberal_arts.current_access_level).to eq('restricted_liberal_arts')
4852
restricted = described_class.new('restricted')
4953
expect(restricted.attributes).to eq('Restricted')
5054
expect(restricted.current_access_level).to eq('restricted')

spec/lib/etda_utilities_etda_file_paths_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
expect(subject.explore_download_file_path(file_id, access_level, filename)).to eq('tmp/restricted_institution/45/345/myfile.pdf')
7373
end
7474

75+
it 'returns a path for restricted_liberal_arts records' do
76+
access_level = 'restricted_liberal_arts'
77+
expect(subject.explore_download_file_path(file_id, access_level, filename)).to eq('tmp/restricted_liberal_arts/45/345/myfile.pdf')
78+
end
79+
7580
it 'returns a path for open_access records' do
7681
access_level = 'open_access'
7782
expect(subject.explore_download_file_path(file_id, access_level, filename)).to eq('tmp/open_access/45/345/myfile.pdf')

0 commit comments

Comments
 (0)