Sha256: e3e5586d51ee5b0000b25bd0603eab33c111df5772283ade99cb8a28eb7f9260

Contents?: true

Size: 262 Bytes

Versions: 117

Compression:

Stored size: 262 Bytes

Contents

module Ddr
  module Auth
    class AttachmentAbilityDefinitions < AbilityDefinitions

      def call
        can :create, ::Attachment do |obj|
          obj.attached_to.present? && can?(:add_attachment, obj.attached_to)
        end
      end

    end
  end
end

Version data entries

117 entries across 117 versions & 1 rubygems

Version Path
ddr-models-2.6.2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.0.rc4 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.0.rc3 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.0.rc2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.6.0.rc1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.5.3 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.5.2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.5.1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.5.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.5.0.rc1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.16 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.15 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.14 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.13 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.12 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-2.4.11 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-3.0.8 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-models-3.0.7 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb