Sha256: c9bab4ebd5be95728c2f03ca72dc2443afe088a45aeeb282953450a3750e1c36

Contents?: true

Size: 456 Bytes

Versions: 37

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    module Abilities
      # Defines the base abilities related to assemblies for any user. Guest users
      # will use these too. Intended to be used with `cancancan`.
      class EveryoneAbility < Decidim::Abilities::EveryoneAbility
        def initialize(user, context)
          super(user, context)

          can :read, Assembly, &:published?
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
decidim-assemblies-0.11.2 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.11.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.11.0.pre1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.10.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.10.0 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.9.3 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.9.2 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.9.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.9.0 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.8.4 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.8.3 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.8.2 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.8.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.8.0 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.7.4 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.7.3 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.7.2 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.7.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.7.0 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.8 app/models/decidim/assemblies/abilities/everyone_ability.rb