theforeman/foreman · error · FilteredGlobalSettingAccessed

Global setting %{name} is not accessible in safe-mode

Error message

Global setting %{name} is not accessible in safe-mode

What it means

Error "Global setting %{name} is not accessible in safe-mode" thrown in theforeman/foreman.

Source

Thrown at app/services/foreman/renderer/scope/macros/base.rb:43

            returns one_of: [true, false]
            raises error: WrongSubnetError, desc: 'when user passes non-subnet object as __subnet__ parameter'
          end
          def subnet_has_param?(subnet, param_name)
            validate_subnet(subnet)
            subnet.parameters.exists?(name: param_name)
          end

          apipie :method, 'Returns the value of global setting' do
            settings = Foreman::Renderer.config.allowed_global_settings.sort.map { |s| "__#{s}__" }.join(', ')
            desc "Not not all settings are exposed, only those which are allowed via safe mode: #{settings}"
            required :name, String, desc: 'the name of the setting which can be found by hovering the setting with mouse cursor in the UI, or via API/CLI'
            optional :blank_default, Object, desc: 'if the setting is not set to any value, this value will be returned instead', default: nil
            raises error: FilteredGlobalSettingAccessed, desc: 'when user setting is not accessible in safe mode'
            returns Object, desc: 'The value of global setting, e.g. String, Integer, Array, Provisioning Template etc'
            example "global_setting('outofsync_interval', 30) # => 30"
          end
          def global_setting(name, blank_default = nil)
            raise FilteredGlobalSettingAccessed.new(name: name) if Setting[:safemode_render] && !Foreman::Renderer.config.allowed_global_settings.include?(name.to_sym)
            setting = Foreman.settings.find(name)
            (setting.settings_type != "boolean" && setting.value.blank?) ? blank_default : setting.value
          end

          apipie :method, 'Returns true if plugin with a given name is installed in this Foreman instance' do
            required :name, String, desc: 'The name of the plugin'
            returns one_of: [true, false]
            example "plugin_present?('foreman_ansible') # => true"
            example "plugin_present?('foreman_virt_who_configure') # => false"
          end
          def plugin_present?(name)
            Foreman::Plugin.find(name).present?
          end

          apipie :method, 'Returns the value of parameter set on subnet' do
            required :name, 'Subnet', desc: 'the subnet to load the parameter from'
            required :param_name, String, desc: 'the name of the subnet parameter'
            returns one_of: [nil, Object], desc: 'The value of the parameter, type of the value is determined by the parameter type. If the parameter with a given name is undefined for a subnet, nil is returned'

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/foreman/renderer/scope/macros/base.rb:43 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/585c9472992aecba. Report an issue: GitHub.