Module: Sufia::DownloadsControllerBehavior

Extended by:
ActiveSupport::Concern
Included in:
DownloadsController
Defined in:
lib/sufia/downloads_controller_behavior.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#showObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/sufia/downloads_controller_behavior.rb', line 27

def show
  if can? :read, params["id"]
    asset = ActiveFedora::Base.find(params[:id], :cast=>true)
    # we can now examine @asset and determine if we should send_content, or some other action.
    send_content (asset)
  else 
    logger.info "Can not read #{params['id']}"
    redirect_to "/assets/NoAccess.png"
  end
end