Sha256: 357354c296533930cc45a8248203cae0e3f259d713dcc895536acbb196df8b00

Contents?: true

Size: 814 Bytes

Versions: 34

Compression:

Stored size: 814 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

        can :read, Feature do |feature|
          can_manage_process?(feature.participatory_space)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
decidim-core-0.10.1 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.10.0 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.9.3 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.9.2 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.9.1 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.9.0 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.8.4 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.8.3 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.8.2 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.8.1 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.8.0 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.7.4 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.7.3 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.7.2 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.7.1 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.7.0 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.6.8 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-0.6.8 decidim-core/app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-core-0.6.7 app/models/decidim/abilities/participatory_process_admin_ability.rb
decidim-0.6.7 decidim-core/app/models/decidim/abilities/participatory_process_admin_ability.rb