-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal:true | ||
|
||
module Hyrax::Migrator | ||
# methods for Visibility lookup services | ||
module VisibilityMethods | ||
# this should provide access to the read_groups metadata | ||
# in preflight, use the item | ||
# in the migrator use the workflow metadata | ||
def read_groups; end | ||
|
||
# metadata field on asset. | ||
# in preflight, use descMetadata | ||
# in migrator, use work env attributes | ||
def access_restrictions; end | ||
|
||
def lookup(groups) | ||
if groups.include? 'public' | ||
{ visibility: 'open' } | ||
elsif groups.include? 'University-of-Oregon' | ||
{ visibility: 'uo' } | ||
elsif groups.include? 'Oregon-State' | ||
{ visibility: 'osu' } | ||
else | ||
{ visibility: 'restricted' } | ||
end | ||
end | ||
|
||
def comparison_check(visibility) | ||
unless access_restrictions.blank? | ||
return true if visibility[:visibility] != 'open' | ||
|
||
return false | ||
end | ||
true | ||
end | ||
end | ||
end |