Sha256: 3abdcc3a867fa1ff5f315f6995bf923125bc75d31c2741ff6d2e5477511dcc71

Contents?: true

Size: 527 Bytes

Versions: 9

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Debates
    module Abilities
      module Admin
        # Defines the abilities related to debates for an admin user.
        # Intended to be used with `cancancan`.
        class AdminAbility < Decidim::Abilities::AdminAbility
          def define_abilities
            can :manage, Debate do |debate|
              debate.author.blank?
            end
            can :unreport, Debate
            can :hide, Debate
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-debates-0.11.2 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.11.1 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.11.0.pre1 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.10.1 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.10.0 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.9.3 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.9.2 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.9.1 app/models/decidim/debates/abilities/admin/admin_ability.rb
decidim-debates-0.9.0 app/models/decidim/debates/abilities/admin/admin_ability.rb