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-0.6.8 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.7 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.7 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.6 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.6 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.5 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.5 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.4 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.4 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.3 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.3 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.2 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.2 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.1 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.1 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-assemblies-0.6.0 app/models/decidim/assemblies/abilities/everyone_ability.rb
decidim-0.6.0 decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb