Sha256: 65a1ad0f167eb9b69840b8709981b9af2c9697935d06799ab3a6e0124bdd9d93

Contents?: true

Size: 693 Bytes

Versions: 60

Compression:

Stored size: 693 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatorySpaceRoleConfig
    class Base
      def initialize(user_role)
        @user_role = user_role
      end

      # Checks whether the given manifest name is accepted for this role.
      #
      # Returns a boolean.
      def component_is_accessible?(manifest_name)
        return true if accepted_components == [:all]

        accepted_components.include?(manifest_name.to_sym)
      end

      # Public: Lists the names of the accepted components for this role.
      #
      # Returns an Array of Symbols.
      def accepted_components
        [:all]
      end

      private

      attr_reader :user_role
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.4 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.27.9 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.29.0 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.3 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.27.8 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.29.0.rc4 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.29.0.rc3 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.29.0.rc2 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.29.0.rc1 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.2 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.27.7 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.1 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.27.6 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.26.10 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.26.9 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.0 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.27.5 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.0.rc5 app/models/decidim/participatory_space_role_config/base.rb
decidim-core-0.28.0.rc4 app/models/decidim/participatory_space_role_config/base.rb