Sha256: d1962d5c805c3eae64ef82041323994e9897680c5ab860eba299e82dad3aaa9f

Contents?: true

Size: 705 Bytes

Versions: 41

Compression:

Stored size: 705 Bytes

Contents

require 'dynflow'

module ForemanTasks
  # Class for configuring and preparing the Dynflow runtime environment.
  class Dynflow < ::Dynflow::Rails
    require 'foreman_tasks/dynflow/console_authorizer'

    def web_console
      ::Dynflow::Web.setup do
        before do
          if !Setting[:dynflow_enable_console] ||
             (Setting[:dynflow_console_require_auth] && !ConsoleAuthorizer.from_env(env).allow?)
            halt 403, 'Access forbidden'
          end
        end

        set(:custom_navigation) do
          { _('Back to tasks') => "/#{ForemanTasks::TasksController.controller_path}" }
        end
        set(:world) { Rails.application.dynflow.world }
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
foreman-tasks-4.1.6 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.2.3 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.2.2 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.2.1 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.3.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.2.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.1.1 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.1.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.5 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.4 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.3 lib/foreman_tasks/dynflow.rb
foreman-tasks-3.0.6 lib/foreman_tasks/dynflow.rb
foreman-tasks-5.0.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.2 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.1 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.0.1 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.1.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-3.0.5 lib/foreman_tasks/dynflow.rb
foreman-tasks-4.0.0 lib/foreman_tasks/dynflow.rb
foreman-tasks-3.0.4 lib/foreman_tasks/dynflow.rb