Class: CurationConcerns::SingleUseLinksViewerController::Ability
- Inherits:
-
Object
- Object
- CurationConcerns::SingleUseLinksViewerController::Ability
- Includes:
- CanCan::Ability
- Defined in:
- app/controllers/curation_concerns/single_use_links_viewer_controller.rb
Instance Attribute Summary collapse
-
#single_use_link ⇒ Object
readonly
Returns the value of attribute single_use_link.
Instance Method Summary collapse
-
#initialize(user, single_use_link) ⇒ Ability
constructor
A new instance of Ability.
Constructor Details
#initialize(user, single_use_link) ⇒ Ability
Returns a new instance of Ability.
10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/curation_concerns/single_use_links_viewer_controller.rb', line 10 def initialize(user, single_use_link) @user = user || ::User.new @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 if single_use_link end |
Instance Attribute Details
#single_use_link ⇒ Object (readonly)
Returns the value of attribute single_use_link.
8 9 10 |
# File 'app/controllers/curation_concerns/single_use_links_viewer_controller.rb', line 8 def single_use_link @single_use_link end |