Module: Hyrax::CurationConcernController::ClassMethods

Defined in:
app/controllers/concerns/hyrax/curation_concern_controller.rb

Instance Method Summary collapse

Instance Method Details

#cancan_resource_classObject



35
36
37
# File 'app/controllers/concerns/hyrax/curation_concern_controller.rb', line 35

def cancan_resource_class
  Hyrax::ControllerResource
end

#curation_concern_typeObject



31
32
33
# File 'app/controllers/concerns/hyrax/curation_concern_controller.rb', line 31

def curation_concern_type
  _curation_concern_type
end

#curation_concern_type=(curation_concern_type) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'app/controllers/concerns/hyrax/curation_concern_controller.rb', line 21

def curation_concern_type=(curation_concern_type)
  load_and_authorize_resource class: curation_concern_type, instance_name: :curation_concern, except: [:show, :file_manager, :inspect_work]

  # Load the fedora resource to get the etag.
  # No need to authorize for the file manager, because it does authorization via the presenter.
  load_resource class: curation_concern_type, instance_name: :curation_concern, only: :file_manager

  self._curation_concern_type = curation_concern_type
end