Sha256: 40dca3564edf2fb95d4c87f462c6096c49b2b51f353b139f0ae2c65dcb67779e

Contents?: true

Size: 583 Bytes

Versions: 10

Compression:

Stored size: 583 Bytes

Contents

module Hyrax
  class SingleUseLinksViewerController < ApplicationController
    include Hyrax::SingleUseLinksViewerControllerBehavior

    class Ability
      include CanCan::Ability

      attr_reader :single_use_link

      def initialize(user, single_use_link)
        @user = user || ::User.new
        return unless single_use_link

        @single_use_link = single_use_link
        can :read, [ActiveFedora::Base, ::SolrDocument] do |obj|
          single_use_link.valid? && single_use_link.itemId == obj.id && single_use_link.destroy!
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.1.0 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.5 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.4 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.3 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.2 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.1 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.0.rc2 app/controllers/hyrax/single_use_links_viewer_controller.rb
hyrax-1.0.0.rc1 app/controllers/hyrax/single_use_links_viewer_controller.rb
test_hyrax-0.0.1.alpha app/controllers/hyrax/single_use_links_viewer_controller.rb