Sha256: e6dd618004c479998aa5cc0ee435e0eaa35085d7925b723661a82ef411bf0cf3

Contents?: true

Size: 326 Bytes

Versions: 3

Compression:

Stored size: 326 Bytes

Contents

module Ddr
  module Auth
    class PublicationAbilityDefinitions < AbilityDefinitions

      def call
        can :publish, Ddr::Models::Base do |obj|
          !obj.published? && obj.publishable?
        end
        can :unpublish, Ddr::Models::Base do |obj|
          obj.published?
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.13 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-models-3.0.0.beta.12 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-models-3.0.0.beta.11 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb