Class: Decidim::Comments::Abilities::ParticipatoryProcessAdminAbility

Inherits:
Abilities::ParticipatoryProcessAdminAbility
  • Object
show all
Defined in:
app/models/decidim/comments/abilities/participatory_process_admin_ability.rb

Overview

Defines the abilities related to comments for a logged in process admin user. Intended to be used with ‘cancancan`.

Instance Method Summary collapse

Instance Method Details

#define_participatory_process_abilitiesObject



9
10
11
12
13
14
15
# File 'app/models/decidim/comments/abilities/participatory_process_admin_ability.rb', line 9

def define_participatory_process_abilities
  super

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