Sha256: 6de3e7b9245d89877abdc5a630ebfd0c498b2eac846d35b0851f1e47516f16e4

Contents?: true

Size: 265 Bytes

Versions: 43

Compression:

Stored size: 265 Bytes

Contents

module Ddr
  module Auth
    class AttachmentAbilityDefinitions < AbilityDefinitions

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

    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
ddr-core-1.17.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.16.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.15.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.14.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.13.2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.13.1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.13.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.12.2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.12.1 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.12.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.11.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.10.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.9.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.8.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.7.0 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.6.6 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.6.5 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.6.4 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.6.3 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
ddr-core-1.6.2 lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb