Sha256: 0c1f08c38214d16cc83935b7045f122f56c6b1835257bb168617eb8cfe9d8be5

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    module Abilities
      # Defines the abilities related to comments for a logged in process admin user.
      # Intended to be used with `cancancan`.
      class ParticipatoryProcessAdminAbility < Decidim::Abilities::ParticipatoryProcessAdminAbility
        def define_participatory_process_abilities
          super

          can [:manage, :unreport, :hide], Comment do |comment|
            can_manage_process?(comment.component.participatory_space)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-comments-0.11.2 app/models/decidim/comments/abilities/participatory_process_admin_ability.rb
decidim-comments-0.11.1 app/models/decidim/comments/abilities/participatory_process_admin_ability.rb
decidim-comments-0.11.0.pre1 app/models/decidim/comments/abilities/participatory_process_admin_ability.rb