Module: CurationConcern::Embargoable::VisibilityOverride

Included in:
CurationConcern::Embargoable
Defined in:
app/repository_models/curation_concern/embargoable.rb

Overview

Embargo is not a proper citizen in the sufia model. Hence the override. Embargo, as implemented in HydraAccessControls, prevents something from being seen until the release date, then is public.

Instance Method Summary collapse

Instance Method Details

#visibilityObject



19
20
21
22
23
24
25
# File 'app/repository_models/curation_concern/embargoable.rb', line 19

def visibility
  if read_groups.include?(Hydra::AccessControls::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC) &&
    embargo_release_date
    return Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO
  end
  super
end

#visibility=(value) ⇒ Object



10
11
12
13
14
15
16
17
# File 'app/repository_models/curation_concern/embargoable.rb', line 10

def visibility= value
  if value == Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO
    super(Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC)
  else
    self.embargo_release_date = nil
    super(value)
  end
end