Sha256: 9a7b3c1539f35d0594f40d951285e729545b1837befe25f949d85559c46814af

Contents?: true

Size: 931 Bytes

Versions: 7

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

module ForemanSalt
  module Concerns
    # Keys to allow as parameters in the SaltVariable controller
    module SaltOverrideValue
      extend ActiveSupport::Concern

      class_methods do
        def lookup_value_params_filter
          Foreman::ParameterFilter.new(::LookupValue).tap do |filter|
            filter.permit :salt_variable_id, :override_value => {}

            filter.permit_by_context :hidden_value, :host_or_hostgroup, :lookup_key, :lookup_key_id,
                                     :match, :omit, :value, :nested => true

            filter.permit_by_context :id, :_destroy, :ui => false,
                                     :api => false, :nested => true
          end
        end
      end

      def lookup_value_params
        self.class.lookup_value_params_filter.filter_params(params, parameter_filter_context, 'foreman_salt_salt_variable')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_salt-14.0.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.2.4 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.2.3 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.2.2 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.2.1 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.2.0 app/controllers/foreman_salt/concerns/salt_override_value.rb
foreman_salt-13.1.0 app/controllers/foreman_salt/concerns/salt_override_value.rb