Sha256: 08da4cd1ab53f9ac492ffb3eb5e471be2f4aa1cbab9402710c433a546f42f309

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Abilities
    # Defines the abilities for a participatory process admin. Intended to be
    # used with `cancancan`.
    # This ability will not apply to organization admins.
    class ParticipatoryProcessAdminAbility < ParticipatoryProcessRoleAbility
      # Overrides ParticipatoryProcessRoleAbility role method
      def role
        :admin
      end

      # Overrides ParticipatoryProcessRoleAbility define_participatory_process_abilities method
      def define_participatory_process_abilities
        super

        can :read, ParticipatoryProcess do |process|
          can_manage_process?(process)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-core-0.4.2 lib/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.4.1 lib/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.4.3 lib/decidim/abilities/participatory_process_admin_ability.rb