Sha256: 2f0807b045de9de65454ca6325a80fdc86c1a44d037004d117a4ca74770f977e

Contents?: true

Size: 325 Bytes

Versions: 7

Compression:

Stored size: 325 Bytes

Contents

module Ddr
  module Auth
    class PublicationAbilityDefinitions < AbilityDefinitions

      def call
        cannot :publish, Ddr::Resource do |obj|
          obj.published? || !obj.publishable?
        end
        cannot :unpublish, Ddr::Resource do |obj|
          !obj.published?
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ddr-core-1.1.2 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-1.1.1 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-1.1.0 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-1.0.0 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-0.3.0 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-0.2.2 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb
ddr-core-0.2.1 lib/ddr/auth/ability_definitions/publication_ability_definitions.rb